From 30ce7d1dc2140e6a621e14d0bf5f28c8ae44afc3 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 16 Jan 2017 12:03:27 +1100 Subject: [PATCH] Prevent total time from displaying as 0:00 in box score --- templates/event-performance-table.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index 0cf4ba53..00a449a3 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -107,6 +107,14 @@ if ( ! isset( $subs ) ) $subs = array(); $format = sp_array_value( $formats, $key, 'number' ); $placeholder = sp_get_format_placeholder( $format ); + + if ( ! array_key_exists( $key, $totals ) ): + $totals[ $key ] = $placeholder; + endif; + + if ( 'time' === $format ): + $totals[ $key ] = ' '; + endif; $value = '-'; if ( $key == 'position' ): @@ -133,10 +141,6 @@ 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 );