Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#40870 new defect (bug)

Using underscore in meta box id field metabox is not working correctly

Reported by: stode's profile stode Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.5
Component: General Keywords:
Focuses: Cc:


To reproduce this issue: 1. Create a meta box with an id that has underscores(id_with_underscores). 2. Try to put the box after the title. Nothing happens. Replace the underscores with dashes and everything works as expected.

// Render metabox
function render_metabox(){
// Define meta box
                        __( 'Person Details', 'text-domain' ),
function move_metabox_after_title() {
        global $post, $wp_meta_boxes;
        do_meta_boxes( get_current_screen(), 'advanced', $post );
        unset( $wp_meta_boxes[ get_post_type( $post ) ]['advanced'] );
add_action( 'edit_form_after_title', 'move_metabox_after_title' );

Change History (3)

#1 follow-up: @GregRoss
7 years ago

May be related to #35305.

#2 in reply to: ↑ 1 @stode
7 years ago

Replying to GregRoss:

May be related to #35305.

Thanks @GregRoss that could very well be related and your suggestion on #3505 to update docs sounds legit for this too. Unless this behavior could somehow be avoided.

#3 @GregRoss
7 years ago

@stode when I investigated #35305 I didn't find a solution that didn't break something else or have a significant trade off, hence the doc update recommendation.

Note: See TracTickets for help on using tickets.