Fix calendar query for scoreboards

This commit is contained in:
Brian Miyaji
2016-09-22 13:36:52 +10:00
parent a0b556db06
commit 3c3153cccd

View File

@@ -238,8 +238,7 @@ class SP_Calendar extends SP_Custom_Post {
); );
} }
if ( 'auto' === $this->date ) { if ( 'auto' === $this->date && 'any' === $this->status ) {
if ( 'any' === $this->status ) {
$args['post_status'] = 'publish'; $args['post_status'] = 'publish';
$args['order'] = 'DESC'; $args['order'] = 'DESC';
$args['posts_per_page'] = ceil( $this->number / 2 ); $args['posts_per_page'] = ceil( $this->number / 2 );
@@ -252,7 +251,6 @@ class SP_Calendar extends SP_Custom_Post {
$fixtures = get_posts( $args ); $fixtures = get_posts( $args );
$events = array_merge_recursive( $results, $fixtures ); $events = array_merge_recursive( $results, $fixtures );
}
} else { } else {
$events = get_posts( $args ); $events = get_posts( $args );
} }