Add hooks for additional performance calculations

This commit is contained in:
Brian Miyaji
2019-05-31 15:55:03 +10:00
parent dd81afec31
commit 2b1583f0bd
4 changed files with 9 additions and 9 deletions

View File

@@ -420,8 +420,8 @@ class SP_Player_List extends SP_Secondary_Post {
endif;
endforeach;
elseif ( array_key_exists( $key, $totals[ $player_id ] ) ):
$value = floatval( $value );
$totals[ $player_id ][ $key ] += $value;
$add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );
$totals[ $player_id ][ $key ] += $add;
endif;
endforeach;
@@ -601,7 +601,7 @@ class SP_Player_List extends SP_Secondary_Post {
$placeholder = number_format( $placeholder, $stat->precision, '.', '' );
endif;
$placeholders[ $player_id ][ $stat->post_name ] = $placeholder;
$placeholders[ $player_id ][ $stat->post_name ] = apply_filters( 'sportspress_player_performance_table_placeholder', $placeholder, $stat->post_name );
endforeach;
endforeach;