Make WordPress Core

Opened 10 years ago

Last modified 12 months ago

#38734 assigned enhancement

Dogfood the Settings API

Reported by: johnbillion Owned by:
Priority: normal Milestone: Future Release
Component: Options, Meta APIs Version: 2.7
Severity: normal Keywords: needs-patch settings-api
Cc: Focuses: accessibility, administration

Description

WordPress has had a ​Settings API for eight years, but the core settings screens in WordPress don't use it. Instead, these screens use hardcoded sections and fields, which means it's impossible for a plugin to remove sections or fields without removing the entire screen.

There's a new ​Fields API in development but this doesn't mean the core settings screens shouldn't be improved in the meantime by switching to the Settings API.

I think the best approach for this is to address one screen at a time, starting with General Settings, and go from there.

If anyone thinks this change should not be made, speak now or forever hold your peace.

Related: #9296, #15691, #18801, #32396

Attachments (2)

38734.diff​ (33.0 KB ) - added by johnbillion 10 years ago.
38734.2.diff​ (32.7 KB ) - added by afercia 10 years ago.

Download all attachments as: .zip

Change History (22)

#1 @afercia
10 years ago

  • Keywords settings-api added

#2 follow-up: @sc0ttkclark
10 years ago

This would significantly help us in our work with the Fields API by the way, there are certain settings fields on these screens which are not easily reproduced with the normal Settings API sections > fields structure as currently built.

#3 in reply to: ↑ 2 @afercia
10 years ago

  • Focuses accessibility added

Replying to sc0ttkclark:

by the way, there are certain settings fields on these screens which are not easily reproduced with the normal Settings API sections > fields structure

It would be a very good opportunity to simplify some of the settings controls :) see for example #31354 and #31356

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


10 years ago

#5 @afercia
10 years ago

  • Milestone Awaiting Review → 4.8

Discussed in today's weekly accessibility bug-scrub and we'd like to try to do this for at least the General Settings page for 4.8.

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


10 years ago

#7 @afercia
10 years ago

Related (and closed as "maybelater"): #18285 perhaps the most interesting discussion about the Settings API is there.

#8 @rianrietveld
10 years ago

  • Owner set to rianrietveld
  • Status new → assigned

#9 @johnbillion
10 years ago

  • Owner changed from rianrietveld to johnbillion

@johnbillion
10 years ago

#10 @johnbillion
10 years ago

38734.diff​ is an MVP (minimum viable patch) which does the following for the General Settings screen:

  • Registers all of the settings.
  • Registers fields for each of the existing settings table rows.
  • Migrates all the hardcoded fields into settings fields.

TODO: Replace all the new procedural functions with a nice class per settings screen (eg. WP_Settings_General) with a method for each field and setting.

@afercia
10 years ago

#11 @afercia
10 years ago

Noticed there are (also in the current options-general.php) a couple misplaced <span> elements and just thought to fix them. No other changes in the refreshed patch.

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


10 years ago

This ticket was mentioned in ​Slack in #accessibility by sc0ttkclark. ​View the logs.


10 years ago

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


10 years ago

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


10 years ago

#16 @afercia
9 years ago

  • Milestone 4.8 → Future Release

Punting as we're running out of time for the 4.8 release.

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


9 years ago

This ticket was mentioned in ​Slack in #accessibility by afercia. ​View the logs.


9 years ago

#19 @johnbillion
5 years ago

  • Owner johnbillion removed

#20 @MadtownLems
12 months ago

I'm curious about the status of this issue/proposal. It seems set as Future Release, and got some positive comments with nobody really speaking out against the idea, but hasn't gone anywhere in 8 years (beyond John removing himself as owner).

It's still wild to me that Core doesn't "dogfood" its own Settings API. There are plenty of core settings that we don't want our Site Administrators controlling in our MultiSite environments, and we're forced to rely on JS/CSS hacks to try to hide them from people rather than simply and securely removing them with a single line of code.

Note: See TracTickets for help on using tickets.