How can I limit a wordpress meta_box to a single page?
Posted
by farinspace
on Stack Overflow
See other posts from Stack Overflow
or by farinspace
Published on 2010-03-31T02:16:52Z
Indexed on
2010/03/31
2:23 UTC
Read the original article
Hit count: 412
I need a way to limit the meta box to a single page (ID=84) ... if I do the following it works, but sbumit data does not go through and data is not saved ...
add_action('admin_init','violin_init');
function violin_init()
{
if ($_GET['post'] == '84')
{
wp_enqueue_style('violin_admin_css', VIOLIN_THEME_PATH . '/custom/meta.css');
add_meta_box('violin_options_meta', 'Highlight Content', 'violin_options_meta', 'page', 'normal', 'high');
add_action('save_post','violin_save_meta');
}
}
© Stack Overflow or respective owner