[wp-trac] [WordPress Trac] #39441: Improve the Settings API for accessibility and ease of use.

WordPress Trac noreply at wordpress.org
Sun Feb 12 20:52:23 UTC 2017


#39441: Improve the Settings API for accessibility and ease of use.
-------------------------------------+-------------------------------------
 Reporter:  flixos90                 |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Plugins                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  settings-api has-patch   |     Focuses:  accessibility,
  2nd-opinion                        |  administration
-------------------------------------+-------------------------------------

Comment (by flixos90):

 As discussed with @afercia during the last Settings API meeting, I looked
 at the HTML prototypes he created at https://wpaccessibility.github.io
 /test-forms/ (see "General Settings", "Discussion Settings" and "Network
 Settings") and improved the existing patch to be suitable for an
 implementation of these fields. I uploaded the following new files:

 * [attachment:39441.3.diff] is the updated patch for the new Settings API
 behavior. It now has all the default supported field types implemented,
 uses `div` elements with specific classes instead of tables and also
 supports automatic fieldset handling for the default field types. Several
 minor enhancements over the previous patch have been added.
 * [attachment:39441.css.diff] acts closely together with
 [attachment:39441.3.diff] as it provides the CSS required for the table
 replacement markup to display properly. I didn't really dive into it
 deeply, but rather duplicated several styles, just to make it work. This
 would probably need to be redone in a better way before a possible core
 merge.
 * [attachment:39441.implementation.diff] is an implementation of the
 settings fields in "General Settings", using the new Settings API
 behavior. For easier readability of the patch, I put all the code at the
 top of `wp-admin/options-general.php`. There are four custom render
 callbacks, which are needed for a few fields which require very custom
 code. A tiny bit of JavaScript was changed in `wp-
 admin/includes/options.php`, just to apply to some adjusted markup
 correctly.
 * [attachment:39441.field-list.md] is the list of all fields in @afercia's
 prototypes and which of the default callbacks they could use. Only very
 few will need custom callbacks (most of them in "General Settings"), so
 this was a positive thing to find out.

 A thorough review on all of this needs to be done, and tomorrow's meeting
 can be the starting point for that. We must also figure out further ways
 to improve accessibility on the fields and, if necessary, update the
 patches accordingly. The last step will probably be to write further
 implementations for the other settings pages (see #38734 as well).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39441#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list