Make WordPress Core

Opened 9 years ago

Last modified 4 years ago

#33551 assigned enhancement

Settings API: Filter sections and fields before displaying them

Reported by: obenland's profile obenland Owned by: obenland's profile obenland
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Options, Meta APIs Keywords: has-patch needs-docs
Focuses: Cc:


Once a section or settings field was added, there is currently no good way to remove it or change the order they are displayed in. It would be good to add filters in do_settings_section() and do_settings_fields() to allow for that to happen.

We could also think about providing convenience functions to use in a callback to those filters, along the lines of remove_option_whitelist().

Attachments (1)

33551.diff (1.5 KB) - added by obenland 9 years ago.

Download all attachments as: .zip

Change History (6)

9 years ago

#1 @obenland
9 years ago

  • Keywords has-patch needs-docs added
  • Version set to 2.7

Needs a docs review obviously.

/cc @drewapicture.

This ticket was mentioned in Slack in #core by sergey. View the logs.

9 years ago

#3 @SergeyBiryukov
9 years ago

  • Owner set to obenland
  • Status changed from new to assigned

#4 @obenland
9 years ago

  • Milestone changed from 4.4 to Future Release

Helen asked to wait with this until the Fields API had a chance to inform us better about the plan for the Settings API.

#5 @david.binda
4 years ago

I've run into a need of filtering the settings fields today and was about to open a ticket introducing very similar filters :)

Not sure how much the Settings API has changed since 4 years ago, but feels like the patch is still applicable and eventually useful. Any chance this gets re-proritised, and eventually scheduled for some future release?

Note: See TracTickets for help on using tickets.