Support Forums

Looking for support? You can access the support system via your account.

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Timm
    #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 Moderator
    #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)

The topic ‘Post Meta with DATE greater than current OR empty’ is closed to new replies.