Description
The “gform_user_registration_login_args” filter allows the modification of the login form arguments used to create the HTML for the Gravity Forms Login Widget. This filter is used in the User Registration Add-On for Gravity Forms.
Usage
add_filter( 'gform_user_registration_login_args', 'your_function_name', 10, 1 );
Parameters
$args array – An array of the login form arguments used to generate the HTML.
| Parameter | Type | Description |
|---|---|---|
display_title | boolean | Whether to display the login form title. e.g. true |
display_description | boolean | Whether to display the login form description. e.g. true |
display_lost_password | boolean | Whether to display the lost password link. e.g. true |
logged_in_avatar | boolean | Whether to display the user avatar when logged in. e.g. true |
logged_in_links | array | Links displayed to logged-in users. |
logged_in_message | string | Message displayed to logged-in users. e.g. 'You are logged in.' |
logged_out_links | array | Links displayed to logged-out users. |
login_redirect | string | URL to redirect the user to after login. |
logout_redirect | string | URL to redirect the user to after logout. e.g. 'https://example.com' |
tabindex | int | The tab index for the login form fields. e.g. 1 |
theme | string | The theme used to style the login form. Accepted values: orbital, gravity. If not set, the form may appear unstyled. e.g. 'orbital' |
Examples
Set the Login Form Theme to Orbital
add_filter( 'gform_user_registration_login_args', function( $args ) {
$args['theme'] = 'orbital';
return $args;
} );
Remove Logged Out Links
add_filter( 'gform_user_registration_login_args', 'set_html_args', 10, 1 );
function set_html_args( $args ) {
$args['logged_out_links'] = array();
return $args;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in GF_User_Registration::get_login_html() in gravityformsuserregistration/class-gf-user-registration.php.