The gform_user_registration_login_args filter allows you to modify 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. Possible values include:display_title(boolean)display_description(boolean)display_lost_password(boolean)logged_in_avatar(boolean)logged_in_links(array)logged_in_message(string)logged_out_links(array)login_redirect(string)logout_redirect(string)tabindex(int)
More information
See Gravity Forms Docs: gform_user_registration_login_args
This filter is found in gravityformsuserregistration/class-gf-user-registration.php.
Examples
Remove logged out links
This example removes the logged out links from the login widget.
add_filter('gform_user_registration_login_args', 'set_html_args', 10, 1);
function set_html_args($args) {
$args['logged_out_links'] = array();
return $args;
}
Change login redirect
This example changes the login redirect URL.
add_filter('gform_user_registration_login_args', 'change_login_redirect', 10, 1);
function change_login_redirect($args) {
$args['login_redirect'] = '/custom-login-redirect/';
return $args;
}
Change logout redirect
This example changes the logout redirect URL.
add_filter('gform_user_registration_login_args', 'change_logout_redirect', 10, 1);
function change_logout_redirect($args) {
$args['logout_redirect'] = '/custom-logout-redirect/';
return $args;
}
Display lost password link
This example enables the display of the lost password link in the login widget.
add_filter('gform_user_registration_login_args', 'display_lost_password', 10, 1);
function display_lost_password($args) {
$args['display_lost_password'] = true;
return $args;
}
Set tabindex
This example sets the tabindex for the login form elements.
add_filter('gform_user_registration_login_args', 'set_tabindex', 10, 1);
function set_tabindex($args) {
$args['tabindex'] = 5;
return $args;
}