gform_user_registration_login_args

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.

ParameterTypeDescription
display_titlebooleanWhether to display the login form title. e.g. true
display_descriptionbooleanWhether to display the login form description. e.g. true
display_lost_passwordbooleanWhether to display the lost password link. e.g. true
logged_in_avatarbooleanWhether to display the user avatar when logged in. e.g. true
logged_in_linksarrayLinks displayed to logged-in users.
logged_in_messagestringMessage displayed to logged-in users. e.g. 'You are logged in.'
logged_out_linksarrayLinks displayed to logged-out users.
login_redirectstringURL to redirect the user to after login.
logout_redirectstringURL to redirect the user to after logout. e.g. 'https://example.com'
tabindexintThe tab index for the login form fields. e.g. 1
themestringThe theme used to style the login form. Accepted values: orbitalgravity. 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;
} );
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.