diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot index 4f9da2f5..fc2f4e45 100755 Binary files a/assets/fonts/sportspress.eot and b/assets/fonts/sportspress.eot differ diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf index 90644ea7..cc9977a0 100755 Binary files a/assets/fonts/sportspress.ttf and b/assets/fonts/sportspress.ttf differ diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff index a9c09b25..9b9a77e4 100755 Binary files a/assets/fonts/sportspress.woff and b/assets/fonts/sportspress.woff differ diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 0e5efdc9..1f69ffe0 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -191,6 +191,7 @@ class SP_Player_List extends SP_Custom_Post { endif; endforeach; + endforeach; endforeach; @@ -246,7 +247,13 @@ class SP_Player_List extends SP_Custom_Post { $meta = get_post_meta( $stat->ID ); // Add equation to object - $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, null ); + if ( $stat->post_type == 'sp_metric' ): + $stat->equation = null; + else: + $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 ); + endif; + + // Add precision to object $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ); // Add column name to columns @@ -259,19 +266,19 @@ class SP_Player_List extends SP_Custom_Post { if ( ! $player_id ) continue; - $variables = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) ); + $placeholders[ $player_id ] = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) ); foreach ( $stats as $stat ): if ( sp_array_value( $placeholders[ $player_id ], $stat->post_name, '' ) == '' ): - if ( $stat->equation == null ): + if ( $stat->equation === null ): $placeholder = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, null ); if ( $placeholder == null ): $placeholder = '-'; endif; else: // Solve - $placeholder = sp_solve( $stat->equation, $variables, $stat->precision ); + $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision ); // Adjustments $placeholder += sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, 0 ); @@ -290,9 +297,9 @@ class SP_Player_List extends SP_Custom_Post { foreach( $placeholders as $player_id => $player_data ): - // Add player name to row + // Add player number and name to row $merged[ $player_id ] = array(); - + $player_data['number'] = get_post_meta( $player_id, 'sp_number', true ); $player_data['name'] = get_the_title( $player_id ); foreach( $player_data as $key => $value ):