[wp-trac] [WordPress Trac] #39441: Improve the Settings API for accessibility and ease of use.
WordPress Trac
noreply at wordpress.org
Mon Feb 27 09:58:16 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 afercia):
Replying to [comment:13 flixos90]:
@flixos90 thanks very much for the updated patch!
1
The `$title` parameter of `add_settings_field()`: passing a falsy value
(empty string, empty array, false, '0', 0, ...) will output a field
without a label. This shouldn't be allowed. Labels should be always
required. Also, wondering if enforcing a type check would make sense since
having the ability to pass something other than a string doesn't look
right to me.
2
There are different ways to associate a label to a field:
Explicit association: the label doesn't wrap the field and uses a `for`
attribute
{{{
<label for="something" ... >Label text</label>
<input id="something" ... / >
}}}
Implicit association: the label wraps the field and doesn't use a `for
attribute:
{{{
<label ... >Label text
<input id="something" ... / >
</label>
}}}
A mix of the twos:
{{{
<label for="something" ... >Label text
<input id="something" ... / >
</label>
}}}
We should only use Explicit association.
4
For example, the Date and Time format groups of radio buttons have a label
that shouldn't be a label. Radio buttons already have their label.
Instead, "Date Format" and "Time Format" should be legend elements of a
fieldset grouping all the radio buttons.
[[Image(https://cldup.com/2QPysvvMWC.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39441#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list