Add event_id as a variable to Calendar Class
This commit is contained in:
@@ -45,6 +45,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.
|
||||
@@ -277,6 +280,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';
|
||||
|
||||
Reference in New Issue
Block a user