diff --git a/includes/class-sp-league-table.php b/includes/class-sp-league-table.php index 37ace7e6..b7fc58a1 100644 --- a/includes/class-sp-league-table.php +++ b/includes/class-sp-league-table.php @@ -543,10 +543,10 @@ class SP_League_Table extends SP_Custom_Post{ // Use static data if key exists and value is not empty, else use placeholder if ( array_key_exists( $team_id, $tempdata ) && array_key_exists( $key, $tempdata[ $team_id ] ) && $tempdata[ $team_id ][ $key ] != '' ): - $merged[ $team_id ][ $key ] = $tempdata[ $team_id ][ $key ]; - else: - $merged[ $team_id ][ $key ] = $value; + $value = $tempdata[ $team_id ][ $key ]; endif; + + $merged[ $team_id ][ $key ] = $value; endforeach; @@ -645,7 +645,6 @@ class SP_League_Table extends SP_Custom_Post{ return $this->pos; } - /** * Calculate and add games back. * diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index cfb6009f..b4ee0ff3 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -509,10 +509,10 @@ class SP_Player_List extends SP_Custom_Post { // Use static data if key exists and value is not empty, else use placeholder if ( array_key_exists( $player_id, $tempdata ) && array_key_exists( $key, $tempdata[ $player_id ] ) && $tempdata[ $player_id ][ $key ] != '' ): - $merged[ $player_id ][ $key ] = $tempdata[ $player_id ][ $key ]; - else: - $merged[ $player_id ][ $key ] = $value; + $value = $tempdata[ $player_id ][ $key ]; endif; + + $merged[ $player_id ][ $key ] = $value; endforeach; endforeach; @@ -605,5 +605,4 @@ class SP_Player_List extends SP_Custom_Post { // Default sort by number return sp_array_value( $a, 'number', 0 ) - sp_array_value( $b, 'number', 0 ); } - }