[wp-trac] [WordPress Trac] #26579: Add filter for field attributes in wp-login.php

WordPress Trac noreply at wordpress.org
Thu Dec 12 20:14:38 UTC 2013


#26579: Add filter for field attributes in wp-login.php
----------------------------+-----------------------------
 Reporter:  csixty4         |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:
 Severity:  normal          |   Keywords:
----------------------------+-----------------------------
 Client's security team wants us to add autocomplete="off" to the fields on
 the login form. A filter to tweak the attributes used on the login form
 would be handy here. I could see it being used to add classes to the
 field, changing the width, and more.

 So instead of:


 {{{
 <input type="text" name="log" id="user_login" class="input" value="<?php
 echo esc_attr($user_login); ?>" size="20" />
 }}}

 it could be something like (untested):


 {{{
 $user_login_attributes = array(
         'type' => 'text',
         'name' => 'log',
         'id' => 'user_login',
         'class' => 'input',
         'value' => $user_login,
         'size' => '20',
 );

 $user_login_attributes = apply_filters( 'user_login_attributes',
 $user_login_attributes );
 <input <?php foreach( $user_login_attributes as $attribute_name =>
 $attribute_value ) echo $attribute_name . '="' . esc_attr(
 $attribute_value ) . '" '; ?> />
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26579>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list