From 49dda2176b475dd69e865e11ab703956d97fc80b Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Wed, 29 Oct 2014 19:52:29 +1100 Subject: [PATCH] Fix equation groups being overridden when results and outcomes have the same translation --- .../meta-boxes/class-sp-meta-box-equation.php | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php index e7363692..91c2618d 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Meta_Boxes - * @version 1.0 + * @version 1.4.4 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -31,31 +31,31 @@ class SP_Meta_Box_Equation { foreach ( $groups as $group ): switch ( $group ): case 'player_event': - $options[ __( 'Events', 'sportspress' ) ] = array( '$eventsattended' => __( 'Attended', 'sportspress' ), '$eventsplayed' => __( 'Played', 'sportspress' ), '$eventsstarted' => __( 'Started', 'sportspress' ), '$eventssubbed' => __( 'Substituted', 'sportspress' ), '$eventminutes' => __( 'Minutes', 'sportspress' ) ); + $options[ 'Events' ] = array( '$eventsattended' => __( 'Attended', 'sportspress' ), '$eventsplayed' => __( 'Played', 'sportspress' ), '$eventsstarted' => __( 'Started', 'sportspress' ), '$eventssubbed' => __( 'Substituted', 'sportspress' ), '$eventminutes' => __( 'Minutes', 'sportspress' ) ); break; case 'team_event': - $options[ __( 'Events', 'sportspress' ) ] = array( '$eventsplayed' => __( 'Played', 'sportspress' ), '$eventminutes' => __( 'Minutes', 'sportspress' ) ); + $options[ 'Events' ] = array( '$eventsplayed' => __( 'Played', 'sportspress' ), '$eventminutes' => __( 'Minutes', 'sportspress' ) ); break; case 'result': - $options[ __( 'Results', 'sportspress' ) ] = self::optgroup( 'sp_result', array( 'for' => '(' . __( 'for', 'sportspress' ) . ')', 'against' => '(' . __( 'against', 'sportspress' ) . ')' ), null, false ); + $options[ 'Results' ] = self::optgroup( 'sp_result', array( 'for' => '(' . __( 'for', 'sportspress' ) . ')', 'against' => '(' . __( 'against', 'sportspress' ) . ')' ), null, false ); break; case 'outcome': - $options[ __( 'Outcomes', 'sportspress' ) ] = self::optgroup( 'sp_outcome' ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$streak'] = __( 'Streak', 'sportspress' ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$last5'] = __( 'Last 5', 'sportspress' ); - $options[ __( 'Outcomes', 'sportspress' ) ]['$last10'] = __( 'Last 10', 'sportspress' ); + $options[ 'Outcomes' ] = self::optgroup( 'sp_outcome' ); + $options[ 'Outcomes' ]['$streak'] = __( 'Streak', 'sportspress' ); + $options[ 'Outcomes' ]['$last5'] = __( 'Last 5', 'sportspress' ); + $options[ 'Outcomes' ]['$last10'] = __( 'Last 10', 'sportspress' ); break; case 'performance': - $options[ __( 'Performance', 'sportspress' ) ] = self::optgroup( 'sp_performance' ); + $options[ 'Performance' ] = self::optgroup( 'sp_performance' ); break; case 'metric': - $options[ __( 'Metric', 'sportspress' ) ] = self::optgroup( 'sp_metric' ); + $options[ 'Metric' ] = self::optgroup( 'sp_metric' ); break; endswitch; endforeach; // Add operators to options - $options[ __( 'Operators', 'sportspress' ) ] = array( '+' => '+', '-' => '−', '*' => '×', '/' => '÷', '(' => '(', ')' => ')' ); + $options[ 'Operators' ] = array( '+' => '+', '-' => '−', '*' => '×', '/' => '÷', '(' => '(', ')' => ')' ); // Create array of constants $max = 10; @@ -68,7 +68,7 @@ class SP_Meta_Box_Equation { $constants[100] = 100; // Add constants to options - $options[ __( 'Constants', 'sportspress' ) ] = (array) $constants; + $options[ 'Constants' ] = (array) $constants; $options = apply_filters( 'sportspress_equation_options', $options ); ?> @@ -77,7 +77,7 @@ class SP_Meta_Box_Equation { $option ): ?> class="alternate"> - +
$value ): $parts[ $key ] = $value; ?>