Using Gravity Forms ‘gform_zapier_use_stored_body’ PHP filter

The gform_zapier_use_stored_body Gravity Forms PHP filter determines if the already stored body should be used.

Usage

add_filter('gform_zapier_use_stored_body', 'your_function_name', 10, 4);

Parameters

  • $use_body (bool) – If the current body should be used. Defaults to true.
  • $entry (Entry Object) – The current entry.
  • $form (Form Object) – The form object.
  • $feed (Feed Object) – The feed object.

More information

See Gravity Forms Docs: gform_zapier_use_stored_body

Examples

Prevent the use of the stored body

This example prevents the use of the stored body.

add_filter('gform_zapier_use_stored_body', 'disable_use_stored_body', 10, 4);

function disable_use_stored_body($use_body, $entry, $form, $feed) {
    return false;
}

Use stored body based on a form ID

This example uses the stored body only if the form ID is 5.

add_filter('gform_zapier_use_stored_body', 'use_stored_body_for_form_id', 10, 4);

function use_stored_body_for_form_id($use_body, $entry, $form, $feed) {
    return $form['id'] == 5;
}

Use stored body based on entry value

This example uses the stored body if the entry value for field 3 is “Yes”.

add_filter('gform_zapier_use_stored_body', 'use_stored_body_based_on_entry_value', 10, 4);

function use_stored_body_based_on_entry_value($use_body, $entry, $form, $feed) {
    return $entry[3] == 'Yes';
}

Use stored body based on feed meta value

This example uses the stored body if the feed meta value for “custom_meta” is “Enabled”.

add_filter('gform_zapier_use_stored_body', 'use_stored_body_based_on_feed_meta', 10, 4);

function use_stored_body_based_on_feed_meta($use_body, $entry, $form, $feed) {
    return $feed['meta']['custom_meta'] == 'Enabled';
}

Combine conditions to use stored body

This example uses the stored body if the form ID is 5 and the entry value for field 3 is “Yes”.

add_filter('gform_zapier_use_stored_body', 'use_stored_body_combined_conditions', 10, 4);

function use_stored_body_combined_conditions($use_body, $entry, $form, $feed) {
    return $form['id'] == 5 && $entry[3] == 'Yes';
}