-
-
Save DevinWalker/ee9d4e53883460c6bbb8 to your computer and use it in GitHub Desktop.
/** | |
* Remove Rev Slider Metabox | |
*/ | |
if ( is_admin() ) { | |
function remove_revolution_slider_meta_boxes() { | |
remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' ); | |
remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' ); | |
remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' ); | |
} | |
add_action( 'do_meta_boxes', 'remove_revolution_slider_meta_boxes' ); | |
} |
@Mark-Creeten
Ah, yes, my original code had a different condition. So I edited that sample in the gist text editor and didn't test the edit on a site. Thanks for catching that.
Slider Revolution version 6.5.19, the meta box slug is slider_revolution_metabox
and its context is side
. So wherever you put it, the call needs to be:
remove_meta_box('slider_revolution_metabox', $post_type, 'side');
Slider Revolution version 6.5.19, the meta box slug is
slider_revolution_metabox
and its context isside
.
In my example then, the context check could handled as a switch clause to have the remove_meta_box calls still only execute once for each appropriate context.
function remove_revolution_slider_meta_box() {
$contexts = array( 'normal', 'advanced', 'side' );
foreach ( $contexts as $context ) {
$result = remove_meta_box( 'slider_revolution_metabox', null, $context );
error_log( 'Removing metabox from context: ' . $context . ' Result: ' . ( $result ? 'Success' : 'Failed' ) );
}
}
add_action( 'add_meta_boxes', 'remove_revolution_slider_meta_box', 99 );
@brianlayman, did you forgot to set the $postType?
like:
in addition to the solution from @brianlayman, if you have Revolution slider version 6, the metabox ID == 'eg-meta-box'