From 765f10bf6e595cc8e336bf467fee40e0a5fca6de Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 16 Jan 2017 11:56:13 +1100 Subject: [PATCH] Fix player positions displaying as zero --- templates/event-performance-table.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index f2009bde..0cf4ba53 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -133,15 +133,16 @@ if ( ! isset( $subs ) ) $subs = array(); else: $value = $placeholder; endif; + + if ( ! array_key_exists( $key, $totals ) ): + $totals[ $key ] = $placeholder; + endif; + + if ( 'number' === $format ): + $value = floatval( $value ); + $totals[ $key ] += $value; + endif; endif; - if ( ! array_key_exists( $key, $totals ) ): - $totals[ $key ] = $placeholder; - endif; - - if ( 'number' === $format ) { - $value = floatval( $value ); - $totals[ $key ] += $value; - } if ( $mode == 'values' ): echo '' . $value . '';