Using Gravity Forms ‘gform_post_process_feed’ PHP action

The gform_post_process_feed Gravity Forms action is used to perform custom actions when a feed has been processed.

Usage

To use the hook for all add-on feeds:

add_action('gform_post_process_feed', 'your_function_name', 10, 4);

To target a specific add-on:

add_action('gform_{ADDON_SLUG}_post_process_feed', 'your_function_name', 10, 4);

Parameters

  • $feed (Feed Object): The Feed Object that was just processed.
  • $entry (Entry Object): The current entry object, which may have been modified by the processed feed.
  • $form (Form Object): The current form object.
  • $addon (object): The current instance of the GFAddOn object which extends GFFeedAddOn or GFPaymentAddOn (i.e., GFCoupons, GF_User_Registration, GFStripe).

More information

See Gravity Forms Docs: gform_post_process_feed

Examples

Send Notification

Send a notification once a feed has been processed:

add_action('gform_post_process_feed', 'post_process_feed', 10, 4);

function post_process_feed($feed, $entry, $form, $addon) {
    GFAPI::send_notifications($form, $entry, 'some_event');
}

Trigger Slack Feed

Trigger the processing of Slack feeds for an entry after the User Registration Add-On has created the pending activation:

add_action('gform_gravityformsuserregistration_post_process_feed', 'process_slack_feeds_post_ur', 10, 3);

function process_slack_feeds_post_ur($feed, $entry, $form) {
    $key = gform_get_meta($entry['id'], 'activation_key');
    if ($key && function_exists('gf_slack')) {
        gf_slack()->maybe_process_feed($entry, $form);
    }
}