gform_userregistration_login_form

gform_userregistration_login_form

DescriptionUsageParametersExamples1. Change label for Username field2. Remove Remember Me fieldPlacementSource Code

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
add_filter( 'gform_userregistration_login_form', 'change_form', 10, 1 );
function change_form( $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;
} );

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.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註