WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18787 closed enhancement (wontfix)

Let remove_meta_box be selective in terms of priorities

Reported by: mitchoyoshitaka Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Right now remove_meta_box actually acts as a ban_meta_box... essentially any meta box with the same id, page, and context will be banned from the page, even if (re)added via another add_meta_box call afterwards. Given that there's no nice replace_meta_box, a nice option would be to allow remove_meta_box to be called with a particular priority in mind, in which case we could easily add_meta_box with that same priority right afterwards and, in practice, replace the meta box.

Attachments (1)

18787.diff (1.1 KB) - added by mitchoyoshitaka 3 years ago.

Download all attachments as: .zip

Change History (4)

mitchoyoshitaka3 years ago

comment:1 follow-up: nacin3 years ago

essentially any meta box with the same id, page, and context will be banned from the page, even if (re)added via another add_meta_box call afterwards.

Isn't that only for priority = core?

comment:2 in reply to: ↑ 1 mitchoyoshitaka3 years ago

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

Replying to nacin:

essentially any meta box with the same id, page, and context will be banned from the page, even if (re)added via another add_meta_box call afterwards.

Isn't that only for priority = core?

Indeed. (Regurgitating the lesson from our quick chat on IRC:) The solution is for non-core code to never add a meta box with priority "core," and even if you want to replace a "core" meta_box, you can simply do so by specifying priority "default" which will get sorted appropriately via the special case code in add_meta_box.

Resolving wontfix.

comment:3 SergeyBiryukov3 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.