[wp-trac] [WordPress Trac] #26474: Add Filter to Username/Password Fields on Login Form?

WordPress Trac noreply at wordpress.org
Sat May 13 21:34:51 UTC 2017


#26474: Add Filter to Username/Password Fields on Login Form?
--------------------------------------+------------------------------
 Reporter:  cgrymala                  |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Login and Registration    |     Version:  3.8
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback needs-patch  |     Focuses:
--------------------------------------+------------------------------

Comment (by davidjlaietta):

 Attached a diff that creates a function to handle password attributes.

 The function applies some defaults, merges in whatever values would be
 default to a specific password field, and allows a filter to add new
 attributes.


 {{{

 add_filter( 'wp_password_input_attributes', 'wporg_add_attributes' );
 function wporg_add_attributes( $defaults ) {
     $attributes = array(
         'new_attribute' => 'new_attribute_val',\
         );

     $attributes = array_merge( $defaults, $attributes );

     return $attributes;
 }
 }}}

 The above is an example usage of the filter to add a new attribute and
 value new_attribute="new_attribute_val"

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


More information about the wp-trac mailing list