[wp-trac] [WordPress Trac] #40462: Add placeholders to wp_login_form()

WordPress Trac noreply at wordpress.org
Mon Oct 2 20:07:59 UTC 2017


#40462: Add placeholders to wp_login_form()
------------------------------------+--------------------------------------
 Reporter:  ramiy                   |       Owner:  voldemortensen
     Type:  enhancement             |      Status:  accepted
 Priority:  normal                  |   Milestone:  4.9
Component:  Login and Registration  |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch close         |     Focuses:  accessibility, template
------------------------------------+--------------------------------------
Changes (by afercia):

 * keywords:  has-patch commit => has-patch close


Comment:

 > It would be helpful to have the placeholder yourusername at companyname.com
 for places that require specific email address domains (such as corporate
 intranet sites).

 Yep, I'd say that's one of the few (maybe only?) correct usage cases of a
 placeholder attribute in a username/email login form. I'd argue the
 password field instead can't have a placeholder as providing a sample
 value or the expected format would be questionable for security reasons.

 > this way developers can "hide" the label with screen-reader-text class
 but kipping them visible for screen readers.

 @ramly `<label>` elements are not just for screen reader users. Hiding
 them, even if only visually, defeats the purpose of properly labeling form
 fields and it is clear in this case the placeholder will be used as a
 visual replacement.

 > describing how to "safely" replace labels with placeholders using
 screen-reader-text class. It's an educational approach.

 there's no "safe" way for the reasons explained above. Labels benefit also
 sighted users. Instead of educating developers, in this case we should
 educate users and customers to explain them why they should ''not'' hide
 labels.

 WordPress shouldn't encourage bad accessibility practices. For this
 reason, I'd propose to close this ticket as "wontfix", also considering
 there's a pending effort to review all the placeholders used in core, see
 #40331.

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


More information about the wp-trac mailing list