Handle deleted players and teams in templates

This commit is contained in:
Brian Miyaji
2014-03-16 18:16:10 +11:00
parent becec8b7bc
commit b05273c707
3 changed files with 14 additions and 5 deletions

View File

@@ -56,6 +56,9 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
$i = 0;
foreach( $data as $player_id => $row ):
$name = sportspress_array_value( $row, 'name', null );
if ( ! $name ) continue;
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
@@ -69,7 +72,6 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
// Name as link
$permalink = get_post_permalink( $player_id );
$name = sportspress_array_value( $row, 'name', sportspress_array_value( $row, 'name', '&nbsp;' ) );
$output .= '<td class="data-name">' . '<a href="' . $permalink . '">' . $name . '</a></td>';
foreach( $labels as $key => $value ):