Using Gravity Forms ‘gform_get_entries_args_entry_list’ PHP filter

The gform_get_entries_args_entry_list filter in Gravity Forms PHP allows you to filter which entries are displayed in the Entry List view by modifying the arguments passed to the GFAPI::get_entries() method.

Usage

To apply the filter to all forms:

add_filter('gform_get_entries_args_entry_list', 'your_function_name', 10, 2);

To apply the filter to form ID 1 only:

add_filter('gform_get_entries_args_entry_list_1', 'your_function_name', 10, 2);

Parameters

  • $args (array): Array of arguments that will be passed to GFAPI::get_entries() to fetch the entries to be displayed.
  • $form_id (int): The form ID for which entries will be loaded.

More information

See Gravity Forms Docs: gform_get_entries_args_entry_list

Examples

Filter Entry List by Entry Meta

This example demonstrates how you could pass a parameter in the query string for a custom meta key and only show entries that match the specified value.

add_filter('gform_get_entries_args_entry_list', function($args) {
    $meta_key = 'my_meta_key';
    $meta_value = rgget($meta_key);

    if (!$meta_value) {
        return $args;
    }

    if (!isset($args['search_criteria']['field_filters'])) {
        $args['search_criteria']['field_filters'] = array();
    }

    $args['search_criteria']['field_filters'][] = array(
        'key' => $meta_key,
        'value' => $meta_value
    );

    return $args;
});

Place this code in the functions.php file of your active theme. This filter was added in Gravity Forms 2.2.3.4. The source code can be found in GF_Entry_List_Table::prepare_items() in entry_list.php.