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
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.