apply_filters( ‘login_form_defaults’, array $defaults )

Filters the default login form output arguments.

Description

See also

Parameters

$defaultsarray
An array of default login form arguments.

More Information

The defaults set in the wp_login_form() function are as follows:

$defaults = array(
'echo' => true,
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
'form_id' => 'loginform',
'label_username' => __( 'Username' ),
'label_password' => __( 'Password' ),
'label_remember' => __( 'Remember Me' ),
'label_log_in' => __( 'Log In' ),
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true,
'value_username' => '',
'value_remember' => false, // Set this to true to default the "Remember me" checkbox to be checked.
);

Source

$args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Example migrated from Codex:

    The following example changes the default labels in the wp_login_form() function:

    add_filter( 'login_form_defaults', 'my_login_page' );
    
    function my_login_page($defaults) {
    	$defaults['label_username'] = __( 'Enter Username' );
    	$defaults['label_password'] = __( 'Enter Password' );
    	$defaults['label_remember'] = __( 'Remember Login State' );
    	$defaults['label_log_in'] = __( 'Please Log In' );
    
    	return $defaults;
    }

You must log in before being able to contribute a note or feedback.