Description
DEPRECATED as of 3.3.0. Use wpmem_login_form_defaults instead.
This hook allows you to override the default inputs for the login form. The default consists of an array with two elements. Each element is an array of the form field input label (name), the field type (text|password), the tag for the input field, the CSS class for the input, and the class for the div wrapper.
New inputs can be added by adding to the array, or the existing inputs can be changed by changing the values in the array.
$default_inputs = array( array( 'name' => "Username or Email", // From $wpmem->get_text( 'login_username' ) 'type' => 'text', 'tag' => 'log', 'class' => 'username', 'div' => 'div_text', ), array( 'name' => "Password", // From $wpmem->get_text( 'login_password' ) 'type' => 'password', 'tag' => 'pwd', 'class' => 'password', 'div' => 'div_text', ), );
Parameters
$default_inputs
(array) (required) An array of elements that make up the login form field inputs.
Usage
The following example changes the label of the username field:
/** * Example changes username field label to * just "Email". * * Anything in the [0] array position is the * username field, the [1] position is the * password. */ add_filter( 'wpmem_inc_login_inputs', 'my_login_inputs' ); function my_login_inputs( $default_inputs ) { $default_inputs[0]['name'] = 'Email'; return $default_inputs; }
Changelog
Introduced in version 2.9.0
Source
wpmem_inc_login_inputs is located in /includes/class-wp-members-forms.php