Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. add_filter( 'get_job_listings_query_args', function( $args ) {
  2. $args['meta_query'][] = [
  3. 'relation' => 'OR',
  4. [
  5. 'key' => '_job_date',
  6. 'value' => date('Y-m-d'),
  7. 'compare' => '>=',
  8. 'type' => 'DATE',
  9. ],
  10. [
  11. 'key' => '_job_date',
  12. 'value' => '',
  13. ],
  14. [
  15. 'key' => '_job_date',
  16. 'compare' => 'NOT EXISTS',
  17. ],
  18. ];
  19.  
  20. return $args;
  21. }, 100 );
  22. add_filter( 'mylisting\sections\listing-feed\args', function( $args ) {
  23. $args['meta_query'][] = [
  24. 'relation' => 'OR',
  25. [
  26. 'key' => '_job_date',
  27. 'value' => date('Y-m-d'),
  28. 'compare' => '>=',
  29. 'type' => 'DATE',
  30. ],
  31. [
  32. 'key' => '_job_date',
  33. 'value' => '',
  34. ],
  35. [
  36. 'key' => '_job_date',
  37. 'compare' => 'NOT EXISTS',
  38. ],
  39. ];
  40.  
  41. return $args;
  42. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement