Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tax_query = array( 'relation' => 'AND' );
- if ( isset( $_GET['audience_type'] ) && $_GET['audience_type'] != '0' ) {
- $tax_query[] = array(
- 'taxonomy' => 'audience_type',
- 'field' => 'slug',
- 'terms' => array( $_GET['audience_type'] )
- );
- }
- if ( isset( $_GET['event_type'] ) && $_GET['event_type'] != '0' ) {
- $tax_query[] = array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => array( $_GET['event_type'] )
- );
- }
- if ( isset( $_GET['event_location'] ) && $_GET['event_location'] != '0' ) {
- $tax_query[] = array(
- 'taxonomy' => 'event_location',
- 'field' => 'slug',
- 'terms' => array( $_GET['event_location'] )
- );
- }
- /* Testing Block
- print_r($selected_date);
- print_r($start_date);
- */
- // required date formats for TEC date filtering
- if ($selected_date != '') {
- $start_date = date("Y-m-d", $selected_date);
- } else {
- $start_date = date("Y-m-d", $today);
- }
- $end_date = date("Y-m-d", $selected_date_plus_three);
- $seperator_date = null;
- $events = tribe_get_events(
- array(
- 'eventDisplay' => 'custom',
- 'posts_per_page' => -1,
- 'start_date' => $start_date,
- 'end_date' => $end_date,
- 'tax_query' => $tax_query,
- //'tribeHideRecurrence' => 1,
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment