Forums Forums Search & Filter Pro Post Meta with DATE greater than current OR empty

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #263371

    I already figured out the solution not via the UI, but with the filter function and query args…

    Maybe it helps someone 🙂

    function filter_function_name( $query_args, $sfid ) {
    
    // your filter pro ID
    if($sfid==123) {
    //modify $query_args here before returning it
    $query_args['meta_query'] = array(
    'relation' => 'OR',
    array(
    'key'		=> 'field',
    'value'		=> date('Ymd'),
    'type'		=> 'DATE',
    'compare'	=> '>='
    ),
    array(
    'key'		=> 'field',
    'value'		=> '',
    'compare' 	=> 'IN'
    )
    );
    
    return $query_args;
    }
    add_filter( 'sf_edit_query_args', 'filter_function_name', 20, 2 );
    Trevor
    #263418

    Thanks for sharing, I am sure others will find that useful.

    I will close this thread for now.

Viewing 3 posts - 1 through 3 (of 3 total)