After upgrading MB and all extensions to the latest versions, I'm no longer able to set meta boxes for page templates successfully.
With the code below, the metabox appears on all pages, briefly, then disappears. It also disappears on the page with the selected page template:
function tmg_register_meta_boxes ( $meta_boxes ) {
$meta_boxes[] = array (
'title' => esc_html__( 'Home - Photo Spotlight', 'tmg' ),
'id' => 'home-photo-spotlight',
'post_types' => array(
'page'
),
'show' => array(
'template' => 'page_home.php'
),
'context' => 'after_title',
'priority' => 'high',
'fields' => array(
array (
'id' => 'home-photo-spotlight-image',
'type' => 'single_image',
'name' => esc_html__( 'Photo Spotlight', 'tmg' ),
'desc' => esc_html__( 'This image appears next to the "Values" section.', 'tmg' ),
),
array (
'id' => 'home-photo-spotlight-credit',
'type' => 'text',
'name' => esc_html__( 'Photo Credit', 'tmg' ),
'desc' => esc_html__( '(Optional) Add a photo credit for this image.', 'tmg' ),
),
),
);
return $meta_boxes;
}
I need the meta box to show up conditionally on pages with the selected template. This method has worked for me in the past, but I can no longer get it to work properly. Help?