[wp-trac] [WordPress Trac] #40870: Using underscore in meta box id field metabox is not working correctly

WordPress Trac noreply at wordpress.org
Fri May 26 11:52:18 UTC 2017


#40870: Using underscore in meta box id field metabox is not working correctly
--------------------------+-----------------------------
 Reporter:  stode         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.7.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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
 <?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' );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40870>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list