Using Gravity Forms ‘gform_entry_list_action’ PHP action

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

Usage

A generic example of how to use the action for 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 include delete, change_columns, trash, restore, unspam, spam, mark_read, mark_unread, add_star, and remove_star. Add-Ons may also use this hook by passing their own action, like 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.

More information

See Gravity Forms Docs: gform_entry_list_action

Implemented in Gravity Forms Version 2.2.4. This action is located in the GF_Entry_List_Table::process_action() in gravityforms/entry_list.php.

Examples

Trigger Twilio Feed

This example shows how to manually trigger Twilio feeds for the selected entries. 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'){
        $form = GFAPI::get_form($form_id);
        foreach ($entries as $entry_id){
            $entry = GFAPI::get_entry($entry_id);
            gf_twilio()->maybe_process_feed($entry, $form);
        }
    }
}

Trigger Zoho CRM Feed

This example shows how to manually trigger Zoho CRM feeds for the selected entries. 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'){
        $form = GFAPI::get_form($form_id);
        foreach ($entries as $entry_id){
            $entry = GFAPI::get_entry($entry_id);
            gf_zohocrm()->maybe_process_feed($entry, $form);
        }
    }
}