Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#26579 closed enhancement (duplicate)

Add filter for field attributes in wp-login.php

Reported by: csixty4's profile csixty4 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:


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 ) . '" '; ?> />

Change History (2)

#1 @TobiasBg
11 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #26474

#2 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.