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