Remove metabox for custom taxonomy
-
Hi, I’ve added a custom taxonomy (‘artist’) to my post using register_taxonomy function in functions.php.
$labels = array( 'name' => _x( 'Add an Artist', 'taxonomy general name' ), 'singular_name' => _x( 'Artist', 'taxonomy singular name' ), 'search_items' => __( 'Search Artists' ), 'popular_items' => __( 'Popular Artists' ), 'all_items' => __( 'All Artists' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Artist' ), 'update_item' => __( 'Update Artist' ), 'add_new_item' => __( 'Add New Artist' ), 'new_item_name' => __( 'New Artist Name' ), 'separate_items_with_commas' => __( 'Separate artists with commas' ), 'add_or_remove_items' => __( 'Add or remove artists' ), 'choose_from_most_used' => __( 'Choose from the most used artists' ) ); register_taxonomy('artist','post',array( 'hierarchical' => false, 'labels' => $labels, 'public' => true, 'show_tagcloud' => true, 'show_ui' => true, 'query_var' => 'artist', 'rewrite' => array( 'slug' => 'artist' ), ));
However, I need to hide the custom taxonomy metabox from some of my new post screens. I’ve tried to use remove_meta_box( ‘artist’ , ‘post’ , ‘normal’ ); wrapped in an if statement, however, with or without the if statement the metabox remains.
function remove_artist_meta() { remove_meta_box( 'artist' , 'post' , 'normal' ); } add_action( 'admin_menu' , 'remove_artist_meta' );
Does anyone know of the first parameter for remove_meta_box is correct as artist, or would it be something else??
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Remove metabox for custom taxonomy’ is closed to new replies.