Fix calculated performance totals missing from array for custom templates
This commit is contained in:
@@ -184,7 +184,7 @@ class SP_Event extends SP_Custom_Post{
|
||||
if ( ! is_array( $players ) ) continue;
|
||||
|
||||
foreach ( $players as $player => $player_performance ):
|
||||
if ( ! is_array( $player_performance ) || ! $player ) continue;
|
||||
if ( ! is_array( $player_performance ) ) continue;
|
||||
|
||||
// Prepare existing values for equation calculation
|
||||
$vars = $player_performance;
|
||||
|
||||
@@ -236,6 +236,7 @@ $i = 0;
|
||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons" colspan="2">';
|
||||
|
||||
foreach ( $labels as $key => $label ):
|
||||
$format = sp_array_value( $formats, $key, 'number' );
|
||||
if ( 'name' == $key )
|
||||
continue;
|
||||
if ( $key == 'position' ):
|
||||
@@ -243,7 +244,7 @@ $i = 0;
|
||||
else:
|
||||
if ( $primary && $key !== $primary ):
|
||||
$value = ' ';
|
||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||
elseif ( 'equation' !== $format && array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||
$value = $row[ $key ];
|
||||
else:
|
||||
$value = apply_filters( 'sportspress_event_performance_table_total_value', sp_array_value( $totals, $key, 0 ), $data, $key );
|
||||
|
||||
Reference in New Issue
Block a user