Sometimes you want to register a custom taxonomy in WordPress and retain the editing UI, but not have your post editing screen littered with a tonne of meta boxes. In my instance, the values assigned to a post are set through an alternative UI or as hidden values.
Fortunately, you can keep the editing UI for custom taxonomies and specify you don't want a metabox with a simple argument.
In your taxonomy options, all you need to provide is the value meta_box_cb
and set it to false
$args = array( 'hierarchical' => false, 'show_ui' => true, 'query_var' => true, 'meta_box_cb' => false ); register_taxonomy( 'mytax', 'post', $args );
It is really that simple.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.