Fix calendar query for scoreboards
This commit is contained in:
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user