set default status in the transformer

This commit is contained in:
André Menrath 2024-10-02 22:40:12 +02:00
parent 4aad867d1f
commit a8627cdb02
2 changed files with 8 additions and 1 deletions

View file

@ -168,6 +168,13 @@ abstract class Event extends Post {
return null; return null;
} }
/**
* Default value for the event status.
*/
protected function get_status(): ?string {
return 'CONFIRMED';
}
/** /**
* Compose a human readable formatted start time. * Compose a human readable formatted start time.
*/ */

View file

@ -94,7 +94,7 @@ final class The_Events_Calendar extends Event {
* *
* @return string status of the event * @return string status of the event
*/ */
public function get_status() { public function get_status(): ?string {
if ( 'canceled' === $this->tribe_event->event_status ) { if ( 'canceled' === $this->tribe_event->event_status ) {
return 'CANCELLED'; return 'CANCELLED';
} }