wp-includes/general-template.php:726Provides a simple login form for use anywhere within WordPress.
$argsarrayoptionalarray()$echobooldefault: true (echo)
$redirectstringdefault: is to redirect back to the request URI
$form_idstringdefault: 'loginform'
$label_usernamestringdefault: 'Username or Email Address'
$label_passwordstringdefault: 'Password'
$label_rememberstringdefault: 'Remember Me'
$label_log_instringdefault: 'Log In'
$id_usernamestringdefault: 'user_login'
$id_passwordstringdefault: 'user_pass'
$id_rememberstringdefault: 'rememberme'
$id_submitstringdefault: 'wp-submit'
$rememberbool
$value_usernamestringdefault: value for the username field. Default empty
$value_rememberbooldefault: false (unchecked)
$required_usernamebooldefault: false
$required_passwordbooldefault: false
void|string4 hooks fire while wp_login_form() runs, in this order:
Filters the default login form output arguments.
Filters content to display at the top of the login form.
Filters content to display in the middle of the login form.
Filters content to display at the bottom of the login form.
function wp_login_form( $args = array() ) { $defaults = array( 'echo' => true, // Default 'redirect' value takes the user back to the request URI. 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'loginform', 'label_username' => __( 'Username or Email Address' ), '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' => '', // Set 'value_remember' to true to default the "Remember me" checkbox to checked. 'value_remember' => false, // Set 'required_username' to true to add the required attribute to username field. 'required_username' => false, // Set 'required_password' to true to add the required attribute to password field. 'required_password' => false, ); /** * Filters the default login form output arguments. * * @since 3.0.0 * * @see wp_login_form() * * @param array $defaults An array of default login form arguments. */ $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) ); /** * Filters content to display at the top of the login form. * * The filter evaluates just following the opening form tag element. * * @since 3.0.0 * * @param string $content Content to display. Default empty. * @param array $args Array of login form arguments. */ $login_form_top = apply_filters( 'login_form_top', '', $args ); /** * Filters content to display in the middle of the login form. * * The filter evaluates just following the location where the 'login-password' * field is displayed. * * @since 3.0.0 * * @param string $content Content to display. Default empty. * @param array $args Array of login form arguments. */ $login_form_middle = apply_filters( 'login_form_middle', '', $args ); /** * Filters content to display at the bottom of the login form. * * The filter evaluates just preceding the closing form tag element. * * @since 3.0.0 * * @param string $content Content to display. Default empty. * @param array $args Array of login form arguments. */ $login_form_bottom = apply_filters( 'login_form_bottom', '', $args ); $direction_style = is_rtl() ? ' style="direction: ltr;"' : ''; $form = sprintf( '<form name="%1$s" id="%1$s" action="%2$s" method="post">', esc_attr( $args['form_id'] ), esc_url( site_url( 'wp-login.php', 'login_post' ) ) ) .Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.