From 6efa3f1e1044bb518d220b94938def1844973805 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 1 May 2018 15:21:10 +1000 Subject: [PATCH] Revert specs in equations --- includes/sp-core-functions.php | 3 -- modules/sportspress-conditional-equations.php | 12 ++++---- modules/sportspress-event-specs.php | 29 ------------------- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 8a5e9726..b1e07140 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -1291,9 +1291,6 @@ if ( !function_exists( 'sp_get_eos_safe_slug' ) ) { if ( !function_exists( 'sp_solve' ) ) { function sp_solve( $equation, $vars, $precision = 0, $default = 0 ) { - - // Add a hook to alter $equation - $equation = apply_filters( 'sportspress_equation_alter', $equation, $vars ); // Add a hook to alter $equation $equation = apply_filters( 'sportspress_equation_alter', $equation, $vars ); diff --git a/modules/sportspress-conditional-equations.php b/modules/sportspress-conditional-equations.php index 760d8e49..3cd5ddee 100644 --- a/modules/sportspress-conditional-equations.php +++ b/modules/sportspress-conditional-equations.php @@ -41,14 +41,14 @@ if ( ! class_exists( 'SportsPress_Conditional_Equations' ) ) : * Define constants. */ private function define_constants() { - if ( !defined( 'SP_Conditional_Equations_VERSION' ) ) - define( 'SP_Conditional_Equations_VERSION', '2.5.10' ); + if ( !defined( 'SP_CONDITIONAL_EQUATIONS_VERSION' ) ) + define( 'SP_CONDITIONAL_EQUATIONS_VERSION', '2.5.10' ); - if ( !defined( 'SP_Conditional_Equations_URL' ) ) - define( 'SP_Conditional_Equations_URL', plugin_dir_url( __FILE__ ) ); + if ( !defined( 'SP_CONDITIONAL_EQUATIONS_URL' ) ) + define( 'SP_CONDITIONAL_EQUATIONS_URL', plugin_dir_url( __FILE__ ) ); - if ( !defined( 'SP_Conditional_Equations_DIR' ) ) - define( 'SP_Conditional_Equations_DIR', plugin_dir_path( __FILE__ ) ); + if ( !defined( 'SP_CONDITIONAL_EQUATIONS_DIR' ) ) + define( 'SP_CONDITIONAL_EQUATIONS_DIR', plugin_dir_path( __FILE__ ) ); } /** diff --git a/modules/sportspress-event-specs.php b/modules/sportspress-event-specs.php index 56164b3d..34eab80e 100644 --- a/modules/sportspress-event-specs.php +++ b/modules/sportspress-event-specs.php @@ -41,8 +41,6 @@ class SportsPress_Event_Specs { add_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) ); add_filter( 'sportspress_event_details', array( $this, 'event_details' ), 10, 2 ); add_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) ); - add_filter( 'sportspress_equation_options', array( $this, 'add_options' ) ); - add_filter( 'sportspress_equation_alter', array( $this, 'alter_equation' ), 11, 2 ); } /** @@ -269,33 +267,6 @@ class SportsPress_Event_Specs { } } } - - /** - * Add additional options. - * - * @return array - */ - public function add_options( $options ) { - $spec_labels = (array)sp_get_var_labels( 'sp_spec', null, false ); - foreach ( $spec_labels as $key => $value ) { - $options[ 'Event Specs' ]['$spec'.$key] = $value; - } - return $options; - } - - /** - * Alter. - * - * @return array - */ - public function alter_equation( $equation, $vars ) { - //var_dump($equation); - //var_dump($vars); - // Remove space between equation parts - $equation = str_replace( ' ', '', $equation ); - - return $equation; - } } endif;