Simplify league table and player list value assignment
This commit is contained in:
@@ -543,11 +543,11 @@ 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;
|
||||
|
||||
endforeach;
|
||||
@@ -645,7 +645,6 @@ class SP_League_Table extends SP_Custom_Post{
|
||||
return $this->pos;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculate and add games back.
|
||||
*
|
||||
|
||||
@@ -509,11 +509,11 @@ 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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user