Snippet: Disable Theme Settings Metabox Completely
// Remove from everywhere
add_filter( 'wpex_metaboxes', '__return_false' );
// Remove from specific post types
add_filter( 'wpex_metaboxes', function( $bool ) {
if ( 'portfolio' != get_post_type( $_GET['post'] ) ) {
$bool = false; // disable on all types besides portfolio
}
return $bool;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)