Link teams in event results

This commit is contained in:
Brian Miyaji
2014-10-19 17:33:36 +11:00
parent a7fdb00b5e
commit f88adc3c3c

View File

@@ -32,6 +32,7 @@ if ( empty( $data ) )
return false;
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
$link_teams = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false;
$show_outcomes = array_key_exists( 'outcome', $labels );
// Initialize
@@ -59,7 +60,13 @@ foreach( $data as $team_id => $result ):
$table_rows .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
$table_rows .= '<td class="data-name">' . get_the_title( $team_id ) . '</td>';
$team_name = get_the_title( $team_id );
if ( $link_teams ):
$team_name = '<a href="' . get_post_permalink( $team_id ) . '">' . $team_name . '</a>';
endif;
$table_rows .= '<td class="data-name">' . $team_name . '</td>';
foreach( $labels as $key => $label ):
if ( in_array( $key, array( 'name', 'outcome' ) ) )