Add filters for career totals
This commit is contained in:
@@ -728,7 +728,8 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
foreach ( $stats as $key => $value ):
|
foreach ( $stats as $key => $value ):
|
||||||
if ( in_array( $key, array( 'name', 'team' ) ) ) continue;
|
if ( in_array( $key, array( 'name', 'team' ) ) ) continue;
|
||||||
$value = floatval( $value );
|
$value = floatval( $value );
|
||||||
$career[ $key ] = sp_array_value( $career, $key, 0 ) + $value;
|
$add = apply_filters( 'sportspress_player_performance_add_value', floatval( $value ), $key );
|
||||||
|
$career[ $key ] = sp_array_value( $career, $key, 0 ) + $add;
|
||||||
endforeach;
|
endforeach;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
@@ -742,6 +743,9 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
$career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision );
|
$career[ $post->post_name ] = sp_solve( $value['equation'], $totals, $precision );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter career total placeholders
|
||||||
|
$career = apply_filters( 'sportspress_player_performance_table_placeholders', $career );
|
||||||
|
|
||||||
// Get manually entered career totals
|
// Get manually entered career totals
|
||||||
$manual_career = sp_array_value( $data, 0, array() );
|
$manual_career = sp_array_value( $data, 0, array() );
|
||||||
$manual_career = array_filter( $manual_career, 'sp_filter_non_empty' );
|
$manual_career = array_filter( $manual_career, 'sp_filter_non_empty' );
|
||||||
|
|||||||
Reference in New Issue
Block a user