gform_userregistration_login_form

Description

The “gform_userregistration_login_form” filter allows the modification of the object for the login form used in the Gravity Forms Login Widget. This filter is used in the User Registration Add-On for Gravity Forms.

Usage

add_filter( 'gform_userregistration_login_form', 'your_function_name', 10, 1 );

Parameters

Examples

1. Change label for Username field

add_filter( 'gform_userregistration_login_form', 'change_login_username', 10, 1 );
function change_login_username( $form ) {
    $fields = $form['fields'];
    foreach ( $fields as &$field ) {
	    if ( $field->label == 'Username' ) {
		    $field->label = 'Please enter your username';
	    }
    }
    return $form;
}

2. Remove Remember Me field

add_filter( 'gform_userregistration_login_form', function ( $form ) {

    // Remove Remember Me field.
    unset ( $form['fields']['2'] );

return $form;
} );

3. Change Login button text

add_filter( 'gform_userregistration_login_form', function ( $form ) {
	$form['button']['text'] = 'Go!';
	return $form;
} );

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GF_User_Registration::login_form_object() in gravityformsuserregistration/class-gf-user-registration.php.