Is there a way to add a metabox for a specific page, I want the metabox to be displayed only on the page “X” in the admin, is there an argument or something that you can specify in order to achive this?
Leave a Reply
You must be logged in to post a comment.
I use the excellent Core Metabox Library for this purpose. Its really easy to implement, and can do pretty much anything as far as I can tell.
This is from the relevant GitHub wiki page:
The type of show_on filter (key) is “id” and the value for that filter is an array of your IDs. If you only wanted it on the About page you could use ‘value’ => 50 instead of putting it in an array.
If you don’t want to use the library, you could find more clues by having a look inside: on line 100 of init.php of the library, it does something like:
(Seriously, though – just use it all – it does uploads, tinymce, taxonomies, the works!)
Hope that Helps!
Tim