Last active
July 10, 2018 08:34
-
-
Save bigdigital/52ef920ba8a4d7f4f21ecc1d1b608d1f to your computer and use it in GitHub Desktop.
The7 add custom post types to microsite metaboxes
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' ) || ( $metabox['id'] == 'dt_page_box-microsite_logo' ) ) { | |
$DT_META_BOXES[$id]['pages'][] = 'my_custom_postytype'; | |
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