Using Gravity Forms ‘gform_password_confirm’ PHP filter

The gform_password_confirm Gravity Forms PHP filter allows you to change the sub-label for the Confirm Password Field.

Usage

To apply your function to all forms:

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

To target a specific form, append the form ID to the hook name (format: gform_password_confirm_FORMID):

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

Parameters

  • $sublabel (string): The sub-label to be filtered.
  • $form_id (integer): ID of the current form.

More information

See Gravity Forms Docs: gform_password_confirm

Examples

Change the password sub-label to “Enter your password again”

This example changes the password sub-label to “Enter your password again” for form ID 185.

add_filter('gform_password_confirm_185', 'set_password_label', 10, 2);

function set_password_label($sublabel, $form_id) {
    return 'Enter your password again';
}

Note: Replace “185” with the appropriate form ID for your use case.