最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - how to add custom select field to wordpress edit page

programmeradmin1浏览0评论

I would like to add a checkbox field to the menu on the right, I googled it but i cant seem to find anything on it, just wondering if anyone has anything on it

I would like to add a checkbox field to the menu on the right, I googled it but i cant seem to find anything on it, just wondering if anyone has anything on it

Share Improve this question asked Feb 27, 2020 at 21:51 Ben FisherBen Fisher 1 2
  • Do you mean on the far right under Document? That is the Inspector sidebar. It depends on what you want the checkbox to do - you can add custom taxonomies or metaboxes that appear there as checkboxes, or if you want something completely different you could look into SlotFills. – WebElaine Commented Feb 27, 2020 at 22:36
  • 2 the expanding and contracting parts are called panels, searching for how to add panels to the block editor will give more useful results – Tom J Nowell Commented Feb 27, 2020 at 22:38
Add a comment  | 

1 Answer 1

Reset to default 0

A legacy solution is to add_meta_box() and set its context as side. This makes the custom metabox visible in the block editor Document sidebar.

The modern way is to add a custom panel with Block API.

Or if you've registered a custom taxonomy with register_taxonomy(), then you need to have show_in_rest parameter set to true to make it visible in the block editor.

发布评论

评论列表(0)

  1. 暂无评论