Created
November 28, 2022 12:17
-
-
Save propertyhive/e89abc8c63339294e4a94b31d518575c to your computer and use it in GitHub Desktop.
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
add_filter( 'propertyhive_property_query_meta_query', 'exclude_completed_more_than_six_months', 10, 2 ); | |
function exclude_completed_more_than_six_months($meta_querys, $q) | |
{ | |
$meta_querys[] = array( | |
'relation' => 'OR', | |
array( | |
'key' => '_completion_date', | |
'compare' => 'NOT EXISTS' | |
), | |
array( | |
'key' => '_completion_date', | |
'value' => '', | |
'compare' => '=' | |
), | |
array( | |
'key' => '_completion_date', | |
'value' => date("Y-m-d", strtotime('6 months ago')), | |
'compare' => '>=' | |
) | |
); | |
return $meta_querys; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment