Description
This filter allows you to pass arguments to the login form function to override default values that are used in the form building process. Note that this function is used to create the login, change password, and reset password forms. The wpmem_login_form() function uses the wp_parse_args() function to merge arguments passed through this filter with the following defaults:
$defaults = array( // wrappers 'heading_before' => '<legend>', 'heading_after' => '</legend>', 'fieldset_before' => '<fieldset>', 'fieldset_after' => '</fieldset>', 'main_div_before' => '<div id="wpmem_login">', 'main_div_after' => '</div>', 'txt_before' => '', 'txt_after' => '', 'row_before' => '', 'row_after' => '', 'buttons_before' => '<div class="button_div">', 'buttons_after' => '</div>', 'link_before' => '<div class="link-text">', 'link_after' => '</div>', 'link_span_before' => '<span class="link-text-%s">', 'link_span_after' => '</span>', // classes & ids 'form_id' => 'wpmem_login_form', 'form_class' => 'form', 'button_id' => '', 'button_class' => 'buttons', // other 'strip_breaks' => true, 'wrap_inputs' => true, 'remember_check' => true, 'n' => "\n", 't' => "\t", 'redirect_to' => $redirect_to, 'login_form_action' => true, );
Parameters
$args
(array) (required) An array of arguments that are to override form $defaults.
$action
(string) (optional) Indicates the form that is being displayed (login|pwdreset|pwdchange|getusername).
Useage
add_filter( 'wpmem_login_form_args', function ( $args, $action ) { // This example adds a div wrapper around each row in the login form. $args['row_before'] = '<div class="my-row-wrapper">'; $args['row_after'] = '</div>'; return $args; }, 10, 2 );
Changelog
Introduced in version 2.9.0
3.1.7 moved to the forms object class, added WP action login_form
3.2.6 Added nonce to the short form
Source
wpmem_login_form_args is located in /includes/class-wp-members-forms.php