Add Home and Away subsets to Table Column Equation Builder

This commit is contained in:
Brian Miyaji
2015-09-27 15:28:16 +10:00
parent 5c555a53a9
commit 612fcd43c4
5 changed files with 100 additions and 12 deletions

View File

@@ -23,6 +23,6 @@ class SP_Meta_Box_Column_Equation extends SP_Meta_Box_Equation {
*/
public static function output( $post ) {
$equation = get_post_meta( $post->ID, 'sp_equation', true );
self::builder( $post->post_title, $equation, array( 'team_event', 'outcome', 'result' ) );
self::builder( $post->post_title, $equation, array( 'team_event', 'outcome', 'result', 'subset', 'preset' ) );
}
}

View File

@@ -41,12 +41,12 @@ class SP_Meta_Box_Equation {
break;
case 'outcome':
$options[ 'Outcomes' ] = self::optgroup( 'sp_outcome' );
$options[ 'Outcomes' ]['$gamesback'] = __( 'Games Back', 'sportspress' );
$options[ 'Outcomes' ]['$homerecord'] = __( 'Home Record', 'sportspress' );
$options[ 'Outcomes' ]['$awayrecord'] = __( 'Away Record', 'sportspress' );
$options[ 'Outcomes' ]['$streak'] = __( 'Streak', 'sportspress' );
$options[ 'Outcomes' ]['$last5'] = __( 'Last 5', 'sportspress' );
$options[ 'Outcomes' ]['$last10'] = __( 'Last 10', 'sportspress' );
break;
case 'preset':
$options[ 'Presets' ] = array( '$gamesback' => __( 'Games Back', 'sportspress' ), '$homerecord' => __( 'Home Record', 'sportspress' ), '$awayrecord' => __( 'Away Record', 'sportspress' ), '$streak' => __( 'Streak', 'sportspress' ), '$last5' => __( 'Last 5', 'sportspress' ), '$last10' => __( 'Last 10', 'sportspress' ) );
break;
case 'subset':
$options[ 'Subsets' ] = array( '_home' => '@' . __( 'Home', 'sportspress' ), '_away' => '@' . __( 'Away', 'sportspress' ) );
break;
case 'performance':
$options[ 'Performance' ] = self::optgroup( 'sp_performance' );
@@ -151,7 +151,9 @@ class SP_Meta_Box_Equation {
* @return null
*/
public static function equation_part_labels() {
__( 'Presets', 'sportspress' );
__( 'Operators', 'sportspress' );
__( 'Subsets', 'sportspress' );
__( 'Constants', 'sportspress' );
}
}