wp_login_form( array $args = array() )
Provides a simple login form for use anywhere within WordPress.
Description
The login form HTML is echoed by default. Pass a false value for $echo
to return it instead.
Parameters
- $args
-
(Optional) Array of options to control the form output. <br>
- 'echo'
(bool) Whether to display the login form or return the form HTML code.<br> Default true (echo).<br> - 'redirect'
(string) URL to redirect to. Must be absolute, as in "<a href="https://example.com/mypage/">https://example.com/mypage/</a>".<br> Default is to redirect back to the request URI.<br> - 'form_id'
(string) ID attribute value for the form. Default 'loginform'.<br> - 'label_username'
(string) Label for the username or email address field. Default 'Username or Email Address'.<br> - 'label_password'
(string) Label for the password field. Default 'Password'.<br> - 'label_remember'
(string) Label for the remember field. Default 'Remember Me'.<br> - 'label_log_in'
(string) Label for the submit button. Default 'Log In'.<br> - 'id_username'
(string) ID attribute value for the username field. Default 'user_login'.<br> - 'id_password'
(string) ID attribute value for the password field. Default 'user_pass'.<br> - 'id_remember'
(string) ID attribute value for the remember field. Default 'rememberme'.<br> - 'id_submit'
(string) ID attribute value for the submit button. Default 'wp-submit'.<br> - 'remember'
(bool) Whether to display the "rememberme" checkbox in the form.<br> - 'value_username'
(string) Default value for the username field. <br> - 'value_remember'
(bool) Whether the "Remember Me" checkbox should be checked by default.<br> Default false (unchecked).<br>
Default value: array()
- 'echo'
Return
(void|string) Void if 'echo' argument is true, login form HTML if 'echo' is false.
Source
File: wp-includes/general-template.php
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |