Skip to content

Instantly share code, notes, and snippets.

@bigdigital
Last active February 14, 2020 15:31
Show Gist options
  • Save bigdigital/926678b62319171401a46aba90264f8a to your computer and use it in GitHub Desktop.
Save bigdigital/926678b62319171401a46aba90264f8a to your computer and use it in GitHub Desktop.
The7 microsite metaboxes to custom page template
function dt_add_CPT_to_microsite_metabox() {
global $DT_META_BOXES;
if ( $DT_META_BOXES ) {
foreach($DT_META_BOXES as $id => $metabox) {
if ( isset( $metabox['id'] ) && ( $metabox['id'] == 'dt_page_box-microsite' ) ) {
$DT_META_BOXES[$id]['only_on']['template'][] = 'template-microsite2.php';
//template-microsite2.php is the copy of the microsite template
break;
}
}
}
}
add_action( 'admin_init', 'dt_add_CPT_to_microsite_metabox', 30 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment