wp_login_form

SummerySummery

Provides a simple login form for use anywhere within WordPress.

Syntax

wp_login_form( array $args = array() )

DescriptionDescription

The login form HTML is echoed by default. Pass a false value for $echo to return it instead.

ParametersParameters

$args

(array) (Optional) Array of options to control the form output.

  • 'echo'
    (bool) Whether to display the login form or return the form HTML code. Default true (echo).
  • 'redirect'
    (string) URL to redirect to. Must be absolute, as in "<a href="https://example.com/mypage/">https://example.com/mypage/</a>". Default is to redirect back to the request URI.
  • 'form_id'
    (string) ID attribute value for the form. Default 'loginform'.
  • 'label_username'
    (string) Label for the username or email address field. Default 'Username or Email Address'.
  • 'label_password'
    (string) Label for the password field. Default 'Password'.
  • 'label_remember'
    (string) Label for the remember field. Default 'Remember Me'.
  • 'label_log_in'
    (string) Label for the submit button. Default 'Log In'.
  • 'id_username'
    (string) ID attribute value for the username field. Default 'user_login'.
  • 'id_password'
    (string) ID attribute value for the password field. Default 'user_pass'.
  • 'id_remember'
    (string) ID attribute value for the remember field. Default 'rememberme'.
  • 'id_submit'
    (string) ID attribute value for the submit button. Default 'wp-submit'.
  • 'remember'
    (bool) Whether to display the "rememberme" checkbox in the form.
  • 'value_username'
    (string) Default value for the username field.
  • 'value_remember'
    (bool) Whether the "Remember Me" checkbox should be checked by default. Default false (unchecked).

Default value: array()

ReturnReturn

(void|string) Void if 'echo' argument is true, login form HTML if 'echo' is false.

SourceSource

File: wp-includes/general-template.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Introduced.
Scroll to Top