Revert specs in equations

This commit is contained in:
Brian Miyaji
2018-05-01 15:21:10 +10:00
parent ef37c3f314
commit 6efa3f1e10
3 changed files with 6 additions and 38 deletions

View File

@@ -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__ ) );
}
/**

View File

@@ -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;