diff --git a/admin/templates/event-players.php b/admin/templates/event-players.php
index 7afa9c9d..fc5c4c9f 100644
--- a/admin/templates/event-players.php
+++ b/admin/templates/event-players.php
@@ -42,6 +42,11 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
if ( ! $player_id )
continue;
+ $name = get_the_title( $player_id );
+
+ if ( ! $name )
+ continue;
+
$output .= '
';
$number = get_post_meta( $player_id, 'sp_number', true );
@@ -51,7 +56,6 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
// Name as link
$permalink = get_post_permalink( $player_id );
- $name = get_the_title( $player_id );
$output .= '| ' . '' . $name . ' | ';
foreach( $statistic_labels as $key => $label ):
diff --git a/admin/templates/league-table.php b/admin/templates/league-table.php
index bf75c105..04c1f050 100644
--- a/admin/templates/league-table.php
+++ b/admin/templates/league-table.php
@@ -41,17 +41,20 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
$i = 0;
if ( is_int( $r['number'] ) && $r['number'] > 0 )
- $data = array_slice( $data, 0, $r['number'] );
+ $limit = $r['number'];
foreach( $data as $team_id => $row ):
+ if ( $i >= $r['number'] ) continue;
+
+ $name = sportspress_array_value( $row, 'name', null );
+ if ( ! $name ) continue;
+
$output .= '
';
// Rank
$output .= '| ' . ( $i + 1 ) . ' | ';
- $name = sportspress_array_value( $row, 'name', sportspress_array_value( $row, 'name', ' ' ) );
-
if ( $r['show_team_logo'] )
$name = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' ) . ' ' . $name;
diff --git a/admin/templates/player-list.php b/admin/templates/player-list.php
index d6a98aad..b300883b 100644
--- a/admin/templates/player-list.php
+++ b/admin/templates/player-list.php
@@ -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 .= '
';
@@ -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', ' ' ) );
$output .= '| ' . '' . $name . ' | ';
foreach( $labels as $key => $value ):