null, 'calendar' => null, 'order' => null, 'orderby' => null, 'league' => null, 'season' => null, 'id' => null, 'title' => null, 'live' => get_option( 'sportspress_enable_live_countdowns', 'yes' ) == 'yes' ? true : false, 'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false, 'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false, 'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false, ); if ( isset( $show_excluded ) && $show_excluded ){ $excluded_statuses = array(); }else{ $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array( 'postponed', 'cancelled', ) ); } if ( isset( $id ) ): $post = get_post( $id ); elseif ( $calendar ): $calendar = new SP_Calendar( $calendar ); if ( $team ) $calendar->team = $team; $calendar->status = 'future'; if ( $order ) { $calendar->order = $order; }else{ $calendar->order = 'ASC'; } if ( $orderby ) { $calendar->orderby = $orderby; } $data = $calendar->data(); /** * Exclude postponed or cancelled events. */ while ( $post = array_shift( $data ) ) { $sp_status = get_post_meta($post->ID, 'sp_status', true); if( ! in_array( $sp_status, $excluded_statuses ) ) { break; } } else: $args = array(); if ( isset( $team ) ) { $args['meta_query'] = array( array( 'key' => 'sp_team', 'value' => $team, ) ); } if ( isset( $league ) || isset( $season ) ) { $args['tax_query'] = array( 'relation' => 'AND' ); if ( isset( $league ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'terms' => $league, ); } if ( isset( $season ) ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_season', 'terms' => $season, ); } } /** * Exclude postponed or cancelled events. */ $args['meta_query'][] = [ 'key' => 'sp_status', 'compare' => 'NOT IN', 'value' => $excluded_statuses, ]; $post = sp_get_next_event( $args ); endif; extract( $defaults, EXTR_SKIP ); if ( ! isset( $post ) || ! $post ) return; if ( $title ) echo '

' . $title . '

'; $title = $post->post_title; if ( $link_events ) $title = '' . $title . ''; if ( $show_status ) { $sp_status = get_post_meta($post->ID, 'sp_status', true); $statuses = apply_filters( 'sportspress_event_statuses', array( 'ok' => __( 'On time', 'sportspress' ), 'tbd' => __( 'TBD', 'sportspress' ), 'postponed' => __( 'Postponed', 'sportspress' ), 'cancelled' => __( 'Canceled', 'sportspress' ), ) ); $title = $title.' ('.$statuses[ $sp_status ].')'; } ?>

ID, 'sp_team' ) ); $i = 0; if ( is_array( $teams ) ) { foreach ( $teams as $team ) { $i++; if ( has_post_thumbnail ( $team ) ) { if ( $link_teams ) { echo ''; } else { echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) ); } } } } } ?>

ID, 'sp_venue' ); if ( $venues ): ?>
ID, 'sp_venue' ); } else { $venue_names = array(); foreach ( $venues as $venue ) { $venue_names[] = $venue->name; } echo implode( '/', $venue_names ); } ?>
ID, 'sp_league' ); if ( $leagues ): foreach( $leagues as $league ): $term = get_term( $league->term_id, 'sp_league' ); ?>
name; ?>
post_date ); $interval = date_diff( $now, $date ); $days = $interval->invert ? 0 : $interval->days; $h = $interval->invert ? 0 : $interval->h; $i = $interval->invert ? 0 : $interval->i; $s = $interval->invert ? 0 : $interval->s; ?>