false, ); $r = wp_parse_args( $args, $defaults ); $output = '
| ' . __( 'Date', 'sportspress' ). ' | '; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) $output .= '' . __( 'Event', 'sportspress' ). ' | '; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ) $output .= '' . __( 'Teams', 'sportspress' ). ' | '; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ) $output .= '' . __( 'Time', 'sportspress' ). ' | '; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ) $output .= '' . __( 'Article', 'sportspress' ). ' | '; $output .= '
|---|---|---|---|---|
| ' . get_post_time( get_option( 'date_format' ), false, $event ) . ' | '; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) $output .= '' . $event->post_title . ' | '; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ): $output .= '';
$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 .= ' | ';
endif;
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
$output .= '' . get_post_time( get_option( 'time_format' ), false, $event ) . ' | '; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ): $output .= ''; if ( $video ): $output .= ''; elseif ( has_post_thumbnail( $event->ID ) ): $output .= ''; endif; if ( $event->post_content !== null ): if ( $event->post_status == 'publish' ): $output .= __( 'Recap', 'sportspress' ); else: $output .= __( 'Preview', 'sportspress' ); endif; endif; $output .= ' | '; endif; $output .= '