Created
May 19, 2015 06:52
-
-
Save jackperry/69d8c4d7327a135f5cda to your computer and use it in GitHub Desktop.
ACF meta_query Post-Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$today = date('Ymd'); | |
$meta_query = array( | |
'relation' => 'OR', | |
array( | |
'key' => 'custom_date', | |
'compare' => '>=', | |
'value' => $today | |
), | |
array( | |
'key' => 'custom_date', | |
'compare' => 'NOT EXISTS', | |
'value' => '' | |
), | |
array( | |
'key' => 'custom_date', | |
'compare' => '=', | |
'value' => '' | |
) | |
); | |
$query->set( 'meta_query', $meta_query ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment