Custom taxonomy terms not showing as list Gutenberg Editor Wordpress

I know this has been asked before, I have searched all over the internet and encountered several people with similar pro

I know this has been asked before, I have searched all over the internet and encountered several people with similar problem and some of them with solutions (none of those solutions worked for me, obviously). Here's how I'm registering my custom taxonomy (labels not included for simplicity):

register_taxonomy( 'location', array( 'restaurant' ), array(
  'labels'             => $labels,
  'public'             => true,
  'hierarchical'       => true,
  'show_ui'            => true,
  'query_var'          => true,
  'show_in_nav_menus'  => true,
  'show_admin_column'  => true,
  'show_in_rest'       => true, // Needed for tax to appear in Gutenberg editor.
  'rewrite'            => array( 'slug' => 'location' ),
));

I don't know if it is related, but here is how I'm registering the Custom Type Post (again, labels not included for simplicity):

$args = array(
    'labels'             => $labels,
    'description'        => __( 'Descripción.', 'text-domain' ),
    'public'             => true,
    'publicly_queryable' => true,
    'show_ui'            => true,
    'show_in_menu'       => true,
  'show_in_rest'       => true,
    'query_var'          => true,
    'rewrite'            => array( 'slug' => 'restaurant' ),
    'capability_type'    => 'post',
    'has_archive'        => true,
    'hierarchical'       => false,
  'taxonomies'         => array('location'),
  'menu-icon'          => 'dashicons-format-gallery',
    'menu_position'      => 5,
    'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
);
register_post_type( 'restaurant', $args );

Result in Gutenberg:

Wraping up: I can use the taxonomies normally outside of Gutenberg and I can see the tab in the document panel in Gutenberg, but taxonomies are not showing up there and also the Add new location button inside Gutenberg does not work

Thanks for your help

I know this has been asked before, I have searched all over the internet and encountered several people with similar problem and some of them with solutions (none of those solutions worked for me, obviously). Here's how I'm registering my custom taxonomy (labels not included for simplicity):

register_taxonomy( 'location', array( 'restaurant' ), array(
  'labels'             => $labels,
  'public'             => true,
  'hierarchical'       => true,
  'show_ui'            => true,
  'query_var'          => true,
  'show_in_nav_menus'  => true,
  'show_admin_column'  => true,
  'show_in_rest'       => true, // Needed for tax to appear in Gutenberg editor.
  'rewrite'            => array( 'slug' => 'location' ),
));

I don't know if it is related, but here is how I'm registering the Custom Type Post (again, labels not included for simplicity):

$args = array(
    'labels'             => $labels,
    'description'        => __( 'Descripción.', 'text-domain' ),
    'public'             => true,
    'publicly_queryable' => true,
    'show_ui'            => true,
    'show_in_menu'       => true,
  'show_in_rest'       => true,
    'query_var'          => true,
    'rewrite'            => array( 'slug' => 'restaurant' ),
    'capability_type'    => 'post',
    'has_archive'        => true,
    'hierarchical'       => false,
  'taxonomies'         => array('location'),
  'menu-icon'          => 'dashicons-format-gallery',
    'menu_position'      => 5,
    'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
);
register_post_type( 'restaurant', $args );

Result in Gutenberg:

Wraping up: I can use the taxonomies normally outside of Gutenberg and I can see the tab in the document panel in Gutenberg, but taxonomies are not showing up there and also the Add new location button inside Gutenberg does not work

Thanks for your help

Share Improve this question asked Oct 6, 2019 at 23:20 SophtSopht 134 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I found the problem. I was registering a custom post type with the same name 'location' as the taxonomy. Renaming one of the two did the job for me.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745102051a4611332.html

相关推荐

  • Custom taxonomy terms not showing as list Gutenberg Editor Wordpress

    I know this has been asked before, I have searched all over the internet and encountered several people with similar pro

    11小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信