Guest User

Untitled

a guest
Mar 2nd, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1.     <?php
  2.     $tax_query = array( 'relation' => 'AND' );
  3.     if ( isset( $_GET['audience_type'] ) && $_GET['audience_type'] != '0' ) {
  4.       $tax_query[] =  array(
  5.         'taxonomy' => 'audience_type',
  6.         'field' => 'slug',
  7.         'terms' => array( $_GET['audience_type'] )
  8.       );
  9.     }
  10.     if ( isset( $_GET['event_type'] ) && $_GET['event_type'] != '0' ) {
  11.       $tax_query[] =  array(
  12.         'taxonomy' => 'tribe_events_cat',
  13.         'field' => 'slug',
  14.         'terms' => array( $_GET['event_type'] )
  15.       );
  16.     }
  17.     if ( isset( $_GET['event_location'] ) && $_GET['event_location'] != '0' ) {
  18.       $tax_query[] =  array(
  19.         'taxonomy' => 'event_location',
  20.         'field' => 'slug',
  21.         'terms' => array( $_GET['event_location'] )
  22.       );
  23.     }
  24.     /* Testing Block
  25.     print_r($selected_date);
  26.     print_r($start_date);
  27.     */
  28.     // required date formats for TEC date filtering
  29.     if ($selected_date != '') {
  30.       $start_date = date("Y-m-d", $selected_date);
  31.     } else  {
  32.       $start_date = date("Y-m-d", $today);
  33.     }
  34.     $end_date = date("Y-m-d", $selected_date_plus_three);
  35.  
  36.     $seperator_date = null;
  37.  
  38.     $events = tribe_get_events(
  39.       array(
  40.         'eventDisplay' => 'custom',
  41.         'posts_per_page' => -1,
  42.         'start_date' => $start_date,
  43.         'end_date' => $end_date,
  44.         'tax_query' => $tax_query,
  45.         //'tribeHideRecurrence' => 1,
  46.       )
  47.     );
Advertisement
Add Comment
Please, Sign In to add comment