I’d like to add a simple checkbox option to the exsisting standard Page Attributes Meta Box.
Is there an obvious/intended way to do that using the WordPress API, rather than registering a new metabox for my one new option?
I’d like to add a simple checkbox option to the exsisting standard Page Attributes Meta Box.
Is there an obvious/intended way to do that using the WordPress API, rather than registering a new metabox for my one new option?
You must be logged in to post a comment.
Unfortunately not. The only way is to deregister the metabox, and then re-register it, supplying your own callback function which mimics the original metabox, but with your alterations (making sure the names of the inputs do not change).
This method is outlined in these posts:
Alternatively you can insert the options with javascript as outlined in:
This is a complete wild attempt to do it, based in
– this Q&A: How to Move the Author Metabox into the “Publish” metabox?
– and the codex first example: http://codex.wordpress.org/Function_Reference/add_meta_box
I’m running the code inside a plugin (
wp-content/mu-plugins/tests.php
) and haven’t tested withfunctions.php
…I cannot guarantee it is a “correct” code, but it works in my local WordPress.
the site here have many question for this, like this search, also a google search
also an working example (git rebo), that you can use and change for your requirement
I do it like this: