WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#19010 closed defect (bug) (fixed)

"Show on screen" checkboxes inconsistency with CPT

Reported by: SergeyBiryukov Owned by:
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

With the "Book" CPT example from Codex:

On the initial "Edit Book" screen load (i.e. when there's no metaboxhidden_book record in wp_usermeta), all meta boxes are displayed, but only "Featured Image" is checked in "Show on screen" options (see the screenshot).

Attachments (2)

19010.edit-book.png (69.7 KB) - added by SergeyBiryukov 8 years ago.
19010.patch (504 bytes) - added by SergeyBiryukov 8 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
8 years ago

Being called from meta_box_prefs() and do_meta_boxes(), get_hidden_meta_boxes() returns different results, due to different $screen values.

In meta_box_prefs(), it's:

WP_Screen Object( [id] => book, [base] => post, ... )

In do_meta_boxes(), it's:

stdClass Object( [id] => book, [base] => book )

Note the difference in base value.

Not sure what the preferred option is, but 19010.patch at least makes it consistent.

#2 @scribu
8 years ago

  • Milestone changed from Awaiting Review to 3.3

This should be looked at, as part of the work on screens.

#3 @ryan
8 years ago

Is this still a problem after [19013]? We should try to pass the current screen object instead of IDs.

#4 @SergeyBiryukov
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [19013].

Note: See TracTickets for help on using tickets.