最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Moving a metabox - not obeying context or removing old

matteradmin10PV0评论

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?

Post a comment

comment list (0)

  1. No comments so far