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',
);
$columns = get_posts( $args );
$performances = get_posts( $args );
$labels = array( array(), array() );
foreach ( $columns as $column ):
$section = get_post_meta( $column->ID, 'sp_section', true );
foreach ( $performances as $performance ):
$section = get_post_meta( $performance->ID, 'sp_section', true );
if ( '' === $section ) {
$section = -1;
}
switch ( $section ):
case 1:
$labels[1][ $column->post_name ] = $column->post_title;
$labels[1][ $performance->post_name ] = $performance->post_title;
break;
default:
$labels[0][ $column->post_name ] = $column->post_title;
$labels[0][ $performance->post_name ] = $performance->post_title;
endswitch;
endforeach;