gform_email_confirm

Description

The gform_email_confirm filter is executed when creating the email field and can be used to modify the “Confirm Email” label.

Usage

Applies to all forms.

add_filter( 'gform_email_confirm', 'change_email_confirm', 10, 2 );

Applies to a specific form. In this case, form id 5.

add_filter( 'gform_email_confirm_5', 'change_email_confirm', 10, 2 );

Parameters

ParameterTypeDescription
$labelstringThe label to be filtered.
$form_idintegerThe current form’s id.

Examples

Change the Confirm Email Label

This example changes the default confirm email label:

add_filter( 'gform_email_confirm', 'change_email_confirm', 10, 2 );
function change_email_confirm( $label, $form_id ) {
	return 'Confirm Your Email';
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in GF_Field_Email::get_field_input() in includes/fields/class-gf-field-email.php.