gform_zapier_sample_field_value

Description

The gform_zapier_sample_field_value filter can be used to modify the sample field value before it is sent to Zapier.

Usage

add_filter( 'gform_zapier_sample_field_value', 'your_function_name', 10, 3 );

Parameters

  • $value string

    The sample value to be modified.

  • $form_id integer

    The ID of the form being processed.

  • $field_id string

    The ID of the field being processed.

Examples

Basic usage

add_filter( 'gform_zapier_sample_field_value', 'zapier_sample_field_value', 10, 3 );
function zapier_sample_field_value( $value, $form_id, $field_id ) {

	return 'the new value';
}

Email Field Example

The following example shows how you can replace the sample value used by the Email type field with your own custom sample value.

add_filter( 'gform_zapier_sample_field_value', function ( $value ) {
	if ( $value === '[email protected]' ) {
		$value = '[email protected]';
	}

	return $value;
} );

Placement

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

Since

This filter was added in version 1.9.1.

Source Code

This filter is located in GFZapier::get_body() in zapier.php.