[wp-trac] [WordPress Trac] #55717: aria-hidden="true" attribute in comment template for visible text (required fields)
WordPress Trac
noreply at wordpress.org
Tue Aug 16 19:12:52 UTC 2022
#55717: aria-hidden="true" attribute in comment template for visible text (required
fields)
---------------------------------------+----------------------------
Reporter: juliemoynat | Owner: audrasjb
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 6.1
Component: Comments | Version: 5.8
Severity: normal | Resolution:
Keywords: has-patch required-fields | Focuses: accessibility
---------------------------------------+----------------------------
Comment (by sabernhardt):
#56389 proposes filters that site owners could use to change the markup
(if they disagree with the decision here, either way).
If you apply both that patch and the one on this ticket, you could try
this:
{{{
add_filter( 'wp_required_field_indicator',
'wptrac_add_aria_hidden_indicator', 10, 1 );
function wptrac_add_aria_hidden_indicator( $indicator ) {
$indicator = str_replace( '<span class="required">', '<span
class="required" aria-hidden="true">', $indicator );
return $indicator;
}
add_filter( 'wp_required_field_message', 'wptrac_add_aria_hidden_message',
10, 1 );
function wptrac_add_aria_hidden_message( $message ) {
$message = str_replace( '<span class="required-field-message">',
'<span class="required-field-message" aria-hidden="true">', $message );
return $message;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55717#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list