logo-antonella-framework-blancologo-antonella-framework-blanco
  • Documentation
  • Support
  • Repositorie
  • Videos
  • Language: English
    • Español Español
    • English English
logo-antonella-framework-blanco
logo-antonella-framework-blanco

Error al Crear Taxonomy en Post

Home Preguntas Error al Crear Taxonomy en Post
Soporte › Categoría: › Error al Crear Taxonomy en Post
1 Votar Buena Votar Mala
Juan José Pastor ha preguntado hace 3 years

Hola buenos dias.
He creado un plugin muy sencillo solo crea una taxonomy en Post.
Cuando edito cualquier post me da el siguiente error:
Warning: array_key_exists(): The first argument should be either a string or an integer in C:\xamp\httdocs\Webs\wordpress_EspacioChai\wp-includes\rest-api\endpoints\class-wp-rest-pots-controller.php on line 2377
El Código que he creado:

    public $taxonomies = [
        [
            “post_type”     => “post”,
            “singular”      => “Imparte”,
            “plural”        => “Impartidores”,
            “slug”          => “imparte”,
            “gutemberg”     => true,
            //advanced
            /*
            “labels”        =>[],
            “args”          =>[],
            “rewrite”       =>[],
            “capabilities”  =>[]             */
        ] 
    ];

1 respuestas
1 Votar Buena Votar Mala
Mejor respuesta
Carlos Herrera Staff ha respondido hace 3 years

Hola Juan y gracias por utilizar el plugin.
Para corregir este error debes ir al archivo PostTypes.php y en la linea 152

$args['rest_base']              = isset($tx['args']['rest_base'])?$tx['args']['rest_base']:true;

reemplazar por esto

$args['rest_base']              = isset($tx['args']['rest_base'])?$tx['args']['rest_base']:$plural;

Esto ya está corregido en el repositorio. a partir de la 1.6.3 ya no tendrás este error. Saludos

Tu respuesta

Powered by Carlos Herrera

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.