false, ); extract( $defaults, EXTR_SKIP ); $output = '
' . '' . '' . ''; list( $data, $usecolumns ) = sportspress_get_calendar_data( $id, true ); if ( isset( $columns ) ) $usecolumns = $columns; $output .= ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) $output .= ''; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ) $output .= ''; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ) $output .= ''; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ) $output .= ''; $output .= '' . '' . ''; $i = 0; foreach ( $data as $event ): $teams = get_post_meta( $event->ID, 'sp_team' ); $results = get_post_meta( $event->ID, 'sp_results', true ); $video = get_post_meta( $event->ID, 'sp_video', true ); $output .= ''; $output .= ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) $output .= ''; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ): $output .= ''; endif; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ) $output .= ''; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ): $output .= ''; endif; $output .= ''; $i++; endforeach; $output .= '' . '
' . SP()->text->string('Date', 'event') . '' . SP()->text->string('Event', 'event') . '' . SP()->text->string('Teams', 'event') . '' . SP()->text->string('Time', 'event') . '' . SP()->text->string('Article', 'event') . '
' . get_post_time( get_option( 'date_format' ), false, $event ) . '' . $event->post_title . ''; $teams = get_post_meta( $event->ID, 'sp_team', false ); if ( $teams ): foreach ( $teams as $team ): $name = get_the_title( $team ); if ( $name ): $team_results = sportspress_array_value( $results, $team, null ); if ( $main_result ): $team_result = sportspress_array_value( $team_results, $main_result, null ); else: if ( is_array( $team_results ) ): end( $team_results ); $team_result = prev( $team_results ); else: $team_result = null; endif; endif; $output .= $name; if ( $team_result != null ): $output .= ' (' . $team_result . ')'; endif; $output .= '
'; endif; endforeach; else: $output .= '—'; endif; $output .= '
' . get_post_time( get_option( 'time_format' ), false, $event ) . ' '; if ( $video ): $output .= '
'; elseif ( has_post_thumbnail( $event->ID ) ): $output .= '
'; endif; if ( $event->post_content !== null ): if ( $event->post_status == 'publish' ): $output .= SP()->text->string('Recap', 'event'); else: $output .= SP()->text->string('Preview', 'event'); endif; endif; $output .= '
'; if ( $id && $show_all_events_link ) $output .= '' . SP()->text->string('View all events', 'event') . ''; $output .= '
'; echo apply_filters( 'sportspress_event_list', $output );