Opened 8 years ago
Last modified 8 years ago
#40870 new defect (bug)
Using underscore in meta box id field metabox is not working correctly
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.7.5 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
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.
<?php // Render metabox function render_metabox(){ ?> <h2>Test</h2> <?php } // Define meta box add_meta_box( 'test_underscore_metabox', __( 'Person Details', 'text-domain' ), 'render_metabox', 'post', 'advanced', 'high', null ); 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' );
Note: See
TracTickets for help on using
tickets.
May be related to #35305.