weixin_39654067
weixin_39654067
2020-12-27 11:34

'meta_box' => false does not hide taxonomy metabox in edit screen

I might have seen you raise this issue on the Gutenberg repo. Can't remember for sure.

After updating to WP 5.0 the 'meta_box' argument when registering a taxonomy is not respected. I have this value set to false and am still seeing the taxonomy metabox in the post edit screen.

Here are my arguments

array( 'public' => false, 'hierarchical' => false, 'show_ui' => true, 'show_admin_column' => false, 'show_in_nav_menus' => false, 'show_in_rest' => true, 'publicly_queryable' => true, 'query_var' => 'city', 'meta_box' => false, 'show_in_quick_edit' => false, ),

该提问来源于开源项目:johnbillion/extended-cpts

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39585070 weixin_39585070 4月前

    Thanks for the report. I've yet decide what to do with regard to Extended CPT meta boxes in WordPress 5.0.

    点赞 评论 复制链接分享
  • weixin_39654067 weixin_39654067 4月前

    I hear ya! Might just have to live with it until move development is done on core. :(

    点赞 评论 复制链接分享
  • weixin_39585070 weixin_39585070 4月前

    I've been looking into this, and 'meta_box' => false works as expected on its own, but including 'show_in_rest' => true has a side effect on it which I'm currently investigating.

    点赞 评论 复制链接分享
  • weixin_39585070 weixin_39585070 4月前

    Most likely cause: https://github.com/WordPress/gutenberg/issues/6912

    点赞 评论 复制链接分享
  • weixin_39585070 weixin_39585070 4月前

    The custom taxonomy meta boxes provided by Extended CPTs appear to work as expected when you register a post type with show_in_rest set to true and a taxonomy with show_in_rest set to false, although they could probably do with some more testing.

    The breakage occurs when the taxonomy also has show_in_rest set to true, in which case the meta box handling gets ignored by the block editor and uses the default one.

    I'm putting this on hold at the moment because a) I don't have much time to look into it, and b) it's dependent on a fix in the block editor.

    点赞 评论 复制链接分享
  • weixin_39585070 weixin_39585070 4月前

    This was fixed in #140

    点赞 评论 复制链接分享

相关推荐