gform_email

Description

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

Usage

Applies to all forms.

add_filter( 'gform_email', 'change_email', 10, 2 );

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

add_filter( 'gform_email_5', 'change_email', 10, 2 );

Parameters

  • $label string

    The label to be filtered.

  • $form_id integer

    The current form’s id.

Examples

This example changes the default email label:

add_filter( 'gform_email', 'change_email', 10, 2 );
function change_email( $label, $form_id ) {
return 'Your Email';
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

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