gform_password

Description

Use this filter to change the Password Field sub-label.

Usage

The following would apply your function to all forms.

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)

add_filter( 'gform_password_6', 'your_function_name', 10, 2 );

Parameters

  • $sublabel string

    The sub-label to be filtered.

  • $form_id integer

    ID of current form.

Examples

This example changes the password sub-label to “Enter a password”.

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.