gform_entry_list_action

Description

The “gform_entry_list_action” action in Gravity Forms fires after the default entry list actions have been processed.

Usage

The following would apply to all forms:

add_action( 'gform_entry_list_action', 'your_function_name', 10, 3 );

To limit the scope of your function to a specific action, append the action name to the end of the hook name. (format:gform_entry_list_action_ACTION)

add_action( 'gform_entry_list_action_trash', 'your_function_name', 10, 3 );

To limit the scope of your function to a specific action and form, append the action name and form id to the end of the hook name. (format:gform_entry_list_action_ACTION_FORMID)

add_action( 'gform_entry_list_action_trash_21', 'your_function_name', 10, 3 );

Parameters

  • $action string

    Action being performed.

    Possible Gravity Forms actions:

    • delete
    • change_columns
    • trash
    • restore
    • unspam
    • spam
    • mark_read
    • mark_unread
    • add_star
    • remove_star

    Add-Ons may also use this hook by passing its own action. For instance, gform_entry_list_action_helpscout.

  • $entries array

    An array of entry ids on which the action is being applied.

  • $form_id int

    The current form id.

Example(s)

Trigger Twilio Feed

This example shows how you can add an action to manually trigger Twilio feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_twilio’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_twilio', 10, 3 );
function gf_trigger_twilio( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_twilio' || ! function_exists( 'gf_twilio' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_twilio()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Trigger Zoho CRM Feed

This example shows how you can add an action to manually trigger Zoho CRM feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_zohocrm’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_zohocrm', 10, 3 );
function gf_trigger_zohocrm( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_zohocrm' || ! function_exists( 'gf_zohocrm' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_zohocrm()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Trigger Zapier Feed

This example shows how you can add an action to manually trigger Zapier feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_zapier’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_zapier', 10, 3 );
function gf_trigger_zapier( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_zapier' || ! function_exists( 'gf_zapier' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_zapier()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Trigger User Registration Feed

This example shows how you can add an action to manually trigger User Registration feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_user_registration’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_user_registration', 10, 3 );
function gf_trigger_user_registration( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_user_registration' || ! function_exists( 'gf_user_registration' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_user_registration()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Trigger Advanced Post Creation Feed

This example shows how you can add an action to manually trigger Advanced Post Creation feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_apc’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_apc', 10, 3 );
function gf_trigger_apc( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_apc' || ! function_exists( 'gf_advancedpostcreation' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_advancedpostcreation()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Trigger Webhooks Feed

This example shows how you can add an action to manually trigger Webhooks feeds for the entries selected. Requires the use of gform_entry_list_bulk_actions to add the ‘trigger_webhooks’ action to the Bulk Actions menu.

add_action( 'gform_entry_list_action', 'gf_trigger_webhooks', 10, 3 );
function gf_trigger_webhooks( $action, $entries, $form_id ) {
	if ( $action !== 'trigger_webhooks' || ! function_exists( 'gf_webhooks' ) ) {
		return;
	}

	$form = GFAPI::get_form( $form_id );
	if ( ! $form ) {
		return;
	}

	foreach ( $entries as $entry_id ) {
		$entry = GFAPI::get_entry( $entry_id );
		if ( is_wp_error( $entry ) ) {
			continue;
		}
		gf_webhooks()->maybe_process_feed( $entry, $form );
	}

	gf_feed_processor()->save()->dispatch();
}

Placement

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

Since

Gravity Forms Version 2.2.4.

Source Code

This filter is located in the GF_Entry_List_Table::process_action() in gravityforms/entry_list.php.