The gform_search_criteria_entry_list filter allows you to modify search criteria used to retrieve entries for display on the Entry List page in Gravity Forms.
Usage
A generic example of using the filter:
add_filter('gform_search_criteria_entry_list', 'your_function_name');
To apply the filter to a specific form, append the form ID to the hook name:
add_filter('gform_search_criteria_entry_list_6', 'your_function_name');
Parameters
- $search_criteria (array): An array containing the search criteria.
More information
See Gravity Forms Docs: gform_search_criteria_entry_list
Examples
Filter entries with specific currency
function filter_entries_by_currency($search_criteria) { $search_criteria['field_filters'][] = array('key' => 'currency', 'value' => 'USD'); return $search_criteria; } add_filter('gform_search_criteria_entry_list', 'filter_entries_by_currency');
Filter entries created by current user
function filter_entries_by_current_user($search_criteria) { $current_user = wp_get_current_user(); $search_criteria['field_filters'][] = array('key' => 'created_by', 'value' => $current_user->ID); return $search_criteria; } add_filter('gform_search_criteria_entry_list', 'filter_entries_by_current_user');
Filter entries by date range
function filter_entries_by_date_range($search_criteria) { $start_date = '2023-01-01'; $end_date = '2023-12-31'; $search_criteria['start_date'] = $start_date; $search_criteria['end_date'] = $end_date; return $search_criteria; } add_filter('gform_search_criteria_entry_list', 'filter_entries_by_date_range');
Filter entries by field value
function filter_entries_by_field_value($search_criteria) { $search_criteria['field_filters'][] = array('key' => '1', 'value' => 'example_value'); return $search_criteria; } add_filter('gform_search_criteria_entry_list', 'filter_entries_by_field_value');
Filter entries by a global search
function filter_entries_by_global_search($search_criteria) { $search_value = 'example_search'; $search_criteria['field_filters'][] = array('value' => $search_value); return $search_criteria; } add_filter('gform_search_criteria_entry_list', 'filter_entries_by_global_search');