Moving a metabox - not obeying context or removing old

admin2025-06-03  2

I have a custom taxonomy called "events category" that is in a custom post type called "events" - I want to move this metabox from the "side context to the "normal" context.

add_action('do_meta_boxes', 'move_event_categories_meta' );

function move_event_categories_meta() {
    remove_meta_box( 'events_locationsdiv', 'events', 'side' );
    add_meta_box('events_locationsdiv', __('XX Categories'), 'post_categories_meta_box', 'events', 'normal', 'high', array( 'taxonomy' => 'events_category' ));
}

There's two things that aren't happening with the above code.

  1. The original metabox still shows
  2. A new metabox is added, but still in the side context, not the normal context.

Can anyone see why this might be going wrong?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748962449a315192.html

最新回复(0)