How to trigger feeds after editing an entry

If you want form feeds to run when an entry is edited, you will need to add some code to your site. This is useful for re-sending emails or sending updated entry data to services such as Zapier

If you are editing an entry and you want to run the Feeds connected to the entry's form after submitting the changes, you can do that by using one of the following code snippets below ( here's how to add the code).

The code samples below target specific forms by their ID. In those examples, it's the ID 100. Please make sure to change that to the specific form ID connected to your View.

Trigger all feeds from a specific form

add_action( 'gravityview/edit_entry/after_update', 'gravityview_trigger_feeds', 10, 3 );

function gravityview_trigger_feeds( $form = array(), $entry_id = array(), $object ) {
  
    if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
		return;
	}
  
	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
  
	gf_apply_filters( array( 'gform_entry_post_save', $form['id'] ), $object->entry, $form );
  
	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
    
}

When using the Zapier Add-On

add_action( 'gravityview/edit_entry/after_update', 'gravityview_trigger_zapier_feed', 10, 3 );

function gravityview_trigger_zapier_feed( $form = array(), $entry_id = array(), $object ) {
	
	if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
		return;
	}

	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

	$Zapier = GF_Zapier::get_instance();
	$Zapier->maybe_process_feed( $object->entry, $form );

	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
}

When using the WebHooks Add-On

add_action( 'gravityview/edit_entry/after_update', 'gravityview_trigger_webhooks_feed', 10, 3 );

function gravityview_trigger_webhooks_feed( $form = array(), $entry_id = array(), $object ) {

	if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
		return;
	}

	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

	$GF_Webhooks = GF_Webhooks::get_instance();
	$GF_Webhooks->maybe_process_feed( $object->entry, $form );

	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
}

When using the Slack Add-On

add_action( 'gravityview/edit_entry/after_update', 'gravityview_trigger_slack_feed', 10, 3 );

function gravityview_trigger_slack_feed( $form = array(), $entry_id = array(), $object ) {

	if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
		return;
	}

	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

	$Slack = GFSlack::get_instance();
	$Slack->maybe_process_feed( $object->entry, $form );

	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
}

Priority is set to something unlikely to be used by other codes (1294873). Feel free to use a different priority.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.