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
1 Answer
Reset to default 0A 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.