Last active
February 14, 2020 15:31
-
-
Save bigdigital/926678b62319171401a46aba90264f8a to your computer and use it in GitHub Desktop.
The7 microsite metaboxes to custom page template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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