Find callback function for custom taxonomy metabox

The callback you need for non-hierarchical taxonomies is post_tags_meta_box.

The callback you need for hierarchical taxonomies is post_categories_meta_box.

For your example, the code would be:

/* Remove movies metabox from sidepanel */
function hide_metabox(){
    remove_meta_box(
        'tagsdiv-movies',
        'your-post-type' ,
        'side'
    );
}
add_action( 'admin_menu' , 'hide_metabox' );


/* Add back movies metabox, but in post area */
add_action('add_meta_boxes', 'add_back_post');
    function add_back_post(){
    add_meta_box(
        'tagsdiv-movies',
        'Movies',
        'post_tags_meta_box',
        'your-post-type',
        'normal',
        'high',
        array( 'taxonomy' => 'movies' )
    );
}

One other important variable is the metabox ID. In your example, tagsdiv-movies targets a metabox for a non-hierarchical taxonomy with slug movies. If that same taxonomy was hierarchical, the ID would be moviesdiv.

Leave a Comment