Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eri-trabiccolo/b0221d158a9bc4893922 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/b0221d158a9bc4893922 to your computer and use it in GitHub Desktop.
Remove Customizr meta boxes from custom post types
//remove customizr metaboxes from custom post types edit screen
add_action( 'add_meta_boxes', 'remove_customizr_metaboxes', 20 );
function remove_customizr_metaboxes() {
//array of custom post types
$custom_post_types = get_post_types( array( '_builtin' => false ) );
$current_post_type = get_post_type();
if ( in_array( $current_post_type, $custom_post_types ) ) {
remove_meta_box('layout_sectionid', $current_post_type, 'normal' );
remove_meta_box('slider_sectionid', $current_post_type, 'normal' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment