Fix box score checkbox selection for split stats in admin

This commit is contained in:
Brian Miyaji
2016-09-22 14:05:32 +10:00
parent 6df6b8e7f9
commit 626625f5b6

View File

@@ -159,20 +159,20 @@ class SP_Meta_Box_Event_Performance {
'order' => 'ASC', 'order' => 'ASC',
); );
$columns = get_posts( $args ); $performances = get_posts( $args );
$labels = array( array(), array() ); $labels = array( array(), array() );
foreach ( $columns as $column ): foreach ( $performances as $performance ):
$section = get_post_meta( $column->ID, 'sp_section', true ); $section = get_post_meta( $performance->ID, 'sp_section', true );
if ( '' === $section ) { if ( '' === $section ) {
$section = -1; $section = -1;
} }
switch ( $section ): switch ( $section ):
case 1: case 1:
$labels[1][ $column->post_name ] = $column->post_title; $labels[1][ $performance->post_name ] = $performance->post_title;
break; break;
default: default:
$labels[0][ $column->post_name ] = $column->post_title; $labels[0][ $performance->post_name ] = $performance->post_title;
endswitch; endswitch;
endforeach; endforeach;