Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34169 closed defect (bug) (invalid)

function do_meta_box with custom meta and some sorted fields

Reported by: toblivar's profile toblivar Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.3
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

While developing a plugin with a custom meta field inside a custom post type, (created using add_meta_box() ) and then trying to tap into edit_form_after_title, it wasn't moving the custom meta field. Upon further investigation I noticed in function do_meta_boxes the code to pull the sorted ones out of their previous context apparently causes the removal of any that have not been sorted.

before sorted code:
var_dump( $wp_meta_boxes[ $page ][ $context ] );

array (size=1)
  'high' => 
    array (size=1)
      'company-region' => 
        array (size=4)
          'id' => string 'company-region' (length=14)
          'title' => string 'Company Region' (length=14)
          'callback' => 
            array (size=2)
              ...
          'args' => null

After sorted code:

array (size=1)
  'high' => 
    array (size=0)
      empty

Change History (1)

#1 @helen
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @toblivar, welcome to Trac. edit_form_after_title is not a metabox area, so if you're trying to add a metabox there, it's not going to work as it's not a valid context. I suspect that's what's going wrong here, but please feel free to reopen with the code you're using to create the field if you find that's not the case.

Note: See TracTickets for help on using tickets.