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
- $form Form Object
The Form Object of the login form.
Examples
1. Change label for Username field
1 2 3 4 5 6 7 8 9 10 | 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
1 2 3 4 5 6 7 | add_filter( 'gform_userregistration_login_form' , function ( $form ) { // Remove Remember Me field. unset ( $form [ 'fields' ][ '2' ] ); return $form ; } ); |
3. Change Login button text
1 2 3 4 | 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.