gravityflow_inbox_search_criteria

Description

The gravityflow_inbox_search_criteria filter allows the search criteria to be modified before entries are searched for the inbox. Refer to the  Gravity Forms API documentation on get_entries for more details on the structure of search_criteria.

Parameters

ParameterTypeDetails
$criteriaArrayThe search criteria.
$argsArrayThe inbox args

Examples

Restricts the inbox to show only active entries from the last 5 days

add_filter( 'gravityflow_inbox_search_criteria', 'sh_gravityflow_inbox_search_criteria', 10, 2 );
function sh_gravityflow_inbox_search_criteria( $search_criteria, $args ) {
    $start_date = date( 'Y-m-d', strtotime('-5 days') );
    $end_date = date( 'Y-m-d', time() );
    $search_criteria['status'] = 'active';
    $search_criteria['start_date'] = $start_date;
    $search_criteria['end_date'] = $end_date;
    
    return $search_criteria;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?