Description
Use this filter to change the Password Field sub-label.
Usage
The following would apply your function to all forms.
1 | add_filter( 'gform_password' , 'your_function_name' , 10, 2 ); |
To target a specific form append the form id to the hook name. (format: gform_password_FORMID)
1 | add_filter( 'gform_password_6' , 'your_function_name' , 10, 2 ); |
Examples
This example changes the password sub-label to “Enter a password”.
1 2 3 4 | add_filter( 'gform_password_185' , 'set_password_label' , 10, 2 ); function set_password_label( $sublabel , $form_id ) { return 'Enter a password' ; } |
Source Code
This filter is located in GF_Field_Password::get_field_input() in includes/fields/class-gf-field-password.php.