From c266bd199a8fcf87ac3fd6155df299e84f783c56 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 29 Apr 2014 19:06:19 +1000 Subject: [PATCH] Also use performance in player profiles --- includes/class-sp-player.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index aa4a82c3..fec860da 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -235,6 +235,10 @@ class SP_Player extends SP_Custom_Post { $placeholders[ $div_id ][ $key ] = sp_solve( $value['equation'], $totals, $value['precision'] ); endforeach; + foreach ( $performance_labels as $key => $label ): + $placeholders[ $div_id ][ $key ] = sp_array_value( $totals, $key, 0 ); + endforeach; + endforeach; // Get stats from statistic variables @@ -281,10 +285,12 @@ class SP_Player extends SP_Custom_Post { endforeach; + $columns = array_merge( $performance_labels, $stats ); + if ( $admin ): - return array( $stats, $data, $placeholders, $merged, $leagues ); + return array( $columns, $data, $placeholders, $merged, $leagues ); else: - $labels = array_merge( array( 'name' => SP()->text->string('Season'), 'team' => SP()->text->string('Team') ), $stats ); + $labels = array_merge( array( 'name' => SP()->text->string('Season'), 'team' => SP()->text->string('Team') ), $columns ); $merged[0] = $labels; return $merged; endif;