Add "Next Team" preset to league tables
This commit is contained in:
@@ -1290,10 +1290,10 @@ if ( !function_exists( 'sp_get_eos_safe_slug' ) ) {
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sp_solve' ) ) {
|
||||
function sp_solve( $equation, $vars, $precision = 0, $default = 0 ) {
|
||||
function sp_solve( $equation, $vars, $precision = 0, $default = 0, $post_id = 0 ) {
|
||||
|
||||
// Add a hook to alter $equation
|
||||
$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars );
|
||||
$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars, $precision, $default );
|
||||
|
||||
if ( $equation == null )
|
||||
return $default;
|
||||
@@ -1347,6 +1347,10 @@ if ( !function_exists( 'sp_solve' ) ) {
|
||||
|
||||
endif;
|
||||
|
||||
if ( $solution = apply_filters( 'sportspress_equation_solve_for_presets', null, $equation, $post_id ) ):
|
||||
return $solution;
|
||||
endif;
|
||||
|
||||
// Remove unnecessary variables from vars before calculating
|
||||
unset( $vars['gamesback'] );
|
||||
unset( $vars['streak'] );
|
||||
|
||||
Reference in New Issue
Block a user