'sp_event', 'posts_per_page' => 1, 'post_status' => 'publish', 'tax_query' => array(), ); if ( isset( $args['number'] ) ): $options['posts_per_page'] = $args['number']; endif; if ( isset( $args['status'] ) && $args['status'] == 'future' ): $options['post_status'] = array( 'future' ); $options['order'] = 'ASC'; endif; if ( isset( $args['league'] ) ): $options['tax_query'][] = array( 'taxonomy' => 'sp_league', 'field' => 'id', 'terms' => $league ); endif; if ( isset( $args['season'] ) ): $options['tax_query'][] = array( 'taxonomy' => 'sp_season', 'field' => 'id', 'terms' => $season ); endif; if ( isset( $args['venue'] ) ): $options['tax_query'][] = array( 'taxonomy' => 'sp_venue', 'field' => 'id', 'terms' => $venue ); endif; $query = new WP_Query( $options ); if ( $query->have_posts() ): $output = '