Created
January 7, 2016 14:58
-
-
Save eri-trabiccolo/b0221d158a9bc4893922 to your computer and use it in GitHub Desktop.
Remove Customizr meta boxes from custom post types
This file contains 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
//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