diff --git a/admin/post-types/list.php b/admin/post-types/list.php index 0813f6c1..7b59ed20 100644 --- a/admin/post-types/list.php +++ b/admin/post-types/list.php @@ -104,7 +104,7 @@ function sp_list_stats_meta( $post ) { $totals[ $player_id ][ $key ] = 0; endforeach; - // Get statis metrics + // Get static metrics $static = get_post_meta( $player_id, 'sp_metrics', true ); // Create placeholders entry for the player @@ -165,6 +165,9 @@ function sp_list_stats_meta( $post ) { // Generate placeholder values for each team foreach ( $player_ids as $player_id ): + if ( ! $player_id ) + continue; + foreach ( $equations as $key => $value ): if ( sp_array_value( $placeholders[ $player_id ], $key, '' ) == '' ): diff --git a/admin/post-types/table.php b/admin/post-types/table.php index baf566e3..2c36a674 100644 --- a/admin/post-types/table.php +++ b/admin/post-types/table.php @@ -154,6 +154,9 @@ function sp_table_stats_meta( $post ) { // Fill in empty placeholder values for each team foreach ( $team_ids as $team_id ): + if ( ! $team_id ) + continue; + foreach ( $equations as $key => $value ): if ( sp_array_value( $placeholders[ $team_id ], $key, '' ) == '' ): $placeholders[ $team_id ][ $key ] = $eos->solveIF( str_replace( ' ', '', $value ), $totals[ $team_id ] );