Apply "Reverse Teams" to home and away records
This commit is contained in:
@@ -550,6 +550,12 @@ class SP_League_Table extends SP_Secondary_Post {
|
|||||||
$totals[ $team_id ]['last10'] = $last10;
|
$totals[ $team_id ]['last10'] = $last10;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
// Reverse home and away records when "Reverse Teams" is enabled.
|
||||||
|
$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
|
||||||
|
if ( $reverse_teams ) {
|
||||||
|
list( $homerecords, $awayrecords ) = array( $awayrecords, $homerecords );
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $homerecords as $team_id => $homerecord ):
|
foreach ( $homerecords as $team_id => $homerecord ):
|
||||||
// Add home record to totals
|
// Add home record to totals
|
||||||
$totals[ $team_id ]['homerecord'] = $homerecord;
|
$totals[ $team_id ]['homerecord'] = $homerecord;
|
||||||
|
|||||||
Reference in New Issue
Block a user