[wp-trac] [WordPress Trac] #60062: Add required attribute to username and password field in wp_login_form function.

WordPress Trac noreply at wordpress.org
Sun Jun 23 21:56:44 UTC 2024


#60062: Add required attribute to username and password field in wp_login_form
function.
-------------------------------------+-------------------------------------
 Reporter:  alesflex                 |       Owner:  audrasjb
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  6.6
Component:  Login and Registration   |     Version:  3.0
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  required-fields has-     |     Focuses:  accessibility,
  patch has-testing-info commit      |  template
  needs-dev-note                     |
-------------------------------------+-------------------------------------

Comment (by joedolson):

 Misc. dev note:

 The `wp_login_form()` function has two new array arguments:
 `required_username` and `required_password`. Passing true to these
 arguments adds the 'required' attribute to the input fields.

 {{{
 $args = array(
     'required_username' => true,
     'required_password' => true,
 );
 wp_login_form( $args );
 }}}

 There is no change to the default field output.

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


More information about the wp-trac mailing list