I already know how to register metaboxes for Posts, Page, and Custom Post Types, but I would like to register a metabox to be shown on my custom admin page, which is not a post.
My plugin has an “Options Page” in the WordPress Admin â I would like to show metaboxes on this very page.
Is this possible? If yes, how can this be acheived?
I saw in the add_meta_box
documentation that one of the possible values for the $post_type
parameter is dashboard
, however this is not documented anywhere. I guess it would show the metabox on the WordPress Dashboard (the main admin screen when logging-in), but this is not what I need or want.
Edit:
This question is about OptionTree Metaboxes, which uses the standard WordPress Metaboxes. Perhaps there is a better way to accomplish this by using OptionTree differently, or by modifying OptionTree? Please see this related question: How to have more than one “Theme Options” page with OptionTree?
if my understanding is right you can do it by following
Here is a Demo plugin that can help you get it working.
Never tried but just an idea.
In your plugins options page url pass another parameter say post-type and provide any new post type name. Then use this parameter value in add_meta_box() function $post_type = $_GET[‘post_type’].