[wp-trac] [WordPress Trac] #47975: Prevent aria-describedby broken reference in `comment_form()`
WordPress Trac
noreply at wordpress.org
Mon Sep 9 02:10:05 UTC 2019
#47975: Prevent aria-describedby broken reference in `comment_form()`
--------------------------+--------------------------------------
Reporter: afercia | Owner: joedolson
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 5.3
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: accessibility, template
--------------------------+--------------------------------------
Changes (by SergeyBiryukov):
* milestone: Awaiting Review => 5.3
Comment:
Replying to [comment:6 dinhtungdu]:
> Is using regex overkill for this ticket?
>
> The simpler version should be check for the presence of `id="email-
notes"` in the comment note, then the theme developers are responsible for
keeping the comment note valid.
Thanks for the patch! That regex does seem like an overkill here, I think
just checking for `id="email-notes"` should be enough.
> Replying to [comment:5 joedolson]:
> > Need to check for ‘email-notes’ within the description string. If
they’re not present, but the string is non-empty, add the id to the
wrapper and print the aria-describedby attribute.
> I don't think we should add the wrapper if the string is non-empty,
because the comment note can contain other information than email
description.
I tend to agree. Looking at the
[https://wpdirectory.net/search/01DM9VHP490K488AKSY33BEGDS themes from the
directory] overriding `comment_notes_before` with a non-empty string, some
of them have the "Your email address will not be published" string without
`id="email-notes"`, however there's no reliable way to check that the
string indeed refers to the email field.
One example would be the
[https://themes.trac.wordpress.org/browser/yoko/1.2.4/comments.php?marks=60#L58
Yoko theme], which adds `Required fields are marked *` as
`comment_notes_before`, but that's not a description for the email field.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47975#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list