Add event_id as a variable to Calendar Class

This commit is contained in:
savvasha
2017-12-10 21:12:14 +02:00
committed by GitHub
parent e9b1d84c41
commit 4c43023175

View File

@@ -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';