Add event_id as a variable to Calendar Class
This commit is contained in:
@@ -46,6 +46,9 @@ class SP_Calendar extends SP_Secondary_Post {
|
||||
/** @var int Number of events. */
|
||||
public $number;
|
||||
|
||||
/** @var int The event ID. */
|
||||
public $event_id;
|
||||
|
||||
/**
|
||||
* __construct function.
|
||||
*
|
||||
@@ -278,6 +281,10 @@ class SP_Calendar extends SP_Secondary_Post {
|
||||
);
|
||||
}
|
||||
|
||||
if ( $this->event_id) {
|
||||
$args['p'] = $this->event_id;
|
||||
}
|
||||
|
||||
if ( 'auto' === $this->date && 'any' === $this->status ) {
|
||||
$args['post_status'] = 'publish';
|
||||
$args['order'] = 'DESC';
|
||||
|
||||
Reference in New Issue
Block a user