Skip to content

Instantly share code, notes, and snippets.

@bigdigital
Last active July 10, 2018 08:34
Show Gist options
  • Save bigdigital/52ef920ba8a4d7f4f21ecc1d1b608d1f to your computer and use it in GitHub Desktop.
Save bigdigital/52ef920ba8a4d7f4f21ecc1d1b608d1f to your computer and use it in GitHub Desktop.
The7 add custom post types to microsite metaboxes
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