daily pastebin goal
66%
SHARE
TWEET

date

a guest Jul 17th, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $evs = get_posts([
  2.     'post_type'=>'evenements',
  3.     'numberposts'=>-1,
  4.     'meta_query' => [
  5.         [
  6.             [ 'key'=>'date_end', 'compare'=>'>', 'value'=>date( "Y-m-d" ), 'type' => 'DATE' ],
  7.             [
  8.                 [ 'key'=>'date_end', 'compare'=> '=', 'value'=>date( "Y-m-d" ), 'type' => 'DATE' ],
  9.                 [ 'key'=>'hour_end', 'compare'=> '>', 'value'=>date( "H:i" ), 'type' => 'TIME' ],
  10.                 'relation'=>'AND'
  11.             ],
  12.             'relation'=>'OR'
  13.         ],
  14.         [
  15.             [ 'key'=>'date_end', 'compare' => '=', 'value'=>'' ],
  16.             [
  17.                 [ 'key'=>'date_start', 'compare'=> '>', 'value'=>date( "Y-m-d" ), 'type' => 'DATE' ],
  18.                 [
  19.                     [ 'key'=>'date_start', 'compare'=> '=', 'value'=>date( "Y-m-d" ), 'type' => 'DATE'],
  20.                     [ 'key'=>'hour_end', 'compare'=> '>', 'value'=>date( "H:i" ), 'type' => 'TIME' ],
  21.                     'relation'=>'AND'
  22.                 ],
  23.                 'relation'=>'OR'
  24.             ],
  25.             'relation'=>'AND'
  26.         ],
  27.         'relation'=>'OR'
  28.     ],
  29.     'orderby'=>'meta_value',
  30.     'order'=>'ASC'
  31. ]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top