I've been googling this for a while, and came across this link here: Can I limit this meta box to a particular page?
What I am trying to achieve is adding a custom Meta Boxe I created onto a CPT Posts Screen (edit.php?post_type=custom
).
What I tried to use is this:
add_action("admin_init", "admin_init");
function admin_init() {
global $pagenow, $page;
if ( 'edit.php' == $pagenow ) {
add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );
}
}
When adding and saving this into my functions.php
, the page turns blank.
Is it even possible to add a meta box to edit.php
pages?
EDIT OP wants to add the "QuickPress" functionality in this meta box. Screenshots from the comments to an answer.
'edit.php' = $pagenow
, should be'edit.php' == $pagenow
, enable debugging so you can see PHP errors. HOWEVER, you can't add a meta box to a post list screen, they are for individual posts. what are you trying to do with this meta box exactly? you specify a certain post ID on a page that lists multiple posts.