Revert specs in equations
This commit is contained in:
@@ -1295,9 +1295,6 @@ if ( !function_exists( 'sp_solve' ) ) {
|
|||||||
// Add a hook to alter $equation
|
// Add a hook to alter $equation
|
||||||
$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars );
|
$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars );
|
||||||
|
|
||||||
// Add a hook to alter $equation
|
|
||||||
$equation = apply_filters( 'sportspress_equation_alter', $equation, $vars );
|
|
||||||
|
|
||||||
if ( $equation == null )
|
if ( $equation == null )
|
||||||
return $default;
|
return $default;
|
||||||
|
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ if ( ! class_exists( 'SportsPress_Conditional_Equations' ) ) :
|
|||||||
* Define constants.
|
* Define constants.
|
||||||
*/
|
*/
|
||||||
private function define_constants() {
|
private function define_constants() {
|
||||||
if ( !defined( 'SP_Conditional_Equations_VERSION' ) )
|
if ( !defined( 'SP_CONDITIONAL_EQUATIONS_VERSION' ) )
|
||||||
define( 'SP_Conditional_Equations_VERSION', '2.5.10' );
|
define( 'SP_CONDITIONAL_EQUATIONS_VERSION', '2.5.10' );
|
||||||
|
|
||||||
if ( !defined( 'SP_Conditional_Equations_URL' ) )
|
if ( !defined( 'SP_CONDITIONAL_EQUATIONS_URL' ) )
|
||||||
define( 'SP_Conditional_Equations_URL', plugin_dir_url( __FILE__ ) );
|
define( 'SP_CONDITIONAL_EQUATIONS_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
if ( !defined( 'SP_Conditional_Equations_DIR' ) )
|
if ( !defined( 'SP_CONDITIONAL_EQUATIONS_DIR' ) )
|
||||||
define( 'SP_Conditional_Equations_DIR', plugin_dir_path( __FILE__ ) );
|
define( 'SP_CONDITIONAL_EQUATIONS_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ class SportsPress_Event_Specs {
|
|||||||
add_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) );
|
add_filter( 'sportspress_config_types', array( $this, 'add_post_type' ) );
|
||||||
add_filter( 'sportspress_event_details', array( $this, 'event_details' ), 10, 2 );
|
add_filter( 'sportspress_event_details', array( $this, 'event_details' ), 10, 2 );
|
||||||
add_filter( 'sportspress_calendar_columns', array( $this, 'calendar_columns' ) );
|
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;
|
endif;
|
||||||
|
|||||||
Reference in New Issue
Block a user