WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 8 weeks ago

#22392 new defect (bug)

save_state() in postbox.js should look at the hidden checkboxes instead of :hidden

Reported by: markoheijnen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords: dev-feedback has-patch 2nd-opinion
Focuses: javascript Cc:

Description

At this moment save_state() looks at all the metaboxes that are really hidden with filter(':hidden'). With can lead to weird behavior when a plugin starts to hide a metabox in some cases since it can be showed/hidden by default.

I was wondering if it is possible to look at the checkboxes and mapped them as a string and pass it to the AJAX action closed-postboxes.

Attachments (1)

22392.diff (606 bytes) - added by markoheijnen 17 months ago.
Change hidden code

Download all attachments as: .zip

Change History (3)

markoheijnen17 months ago

Change hidden code

comment:1 markoheijnen17 months ago

  • Keywords has-patch added; needs-patch removed

comment:2 adamsilverstein8 weeks ago

  • Focuses javascript added
  • Keywords 2nd-opinion added

This patch concept looks fine and in my brief testing I verified that it is returning the same list of ids.

My only concern here would be that checkboxes may not always line up with the actual postboxes (although they should). Also, I'm not certain I understand the use case - you are hiding a metabox manually, but don't want it passed in the 'hidden' list?

Note: See TracTickets for help on using tickets.