Set timezone and status for The Events Calendar (#46)
All checks were successful
PHP Code Checker / PHP Code Checker (push) Successful in 42s
PHPUnit / PHPUnit – PHP 8.1 (push) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.2 (push) Successful in 1m7s
PHPUnit / PHPUnit – PHP 8.3 (push) Successful in 1m2s

Reviewed-on: Event-Federation/wordpress-activitypub-event-extensions#46
This commit is contained in:
André Menrath 2024-10-02 19:53:13 +02:00
commit 2124b1f612
2 changed files with 21 additions and 1 deletions

View file

@ -301,6 +301,17 @@ abstract class Event extends Post {
return $summary;
}
/**
* By default set the timezone of the WordPress site.
*
* This is likely to be overwritten by the actual transformer.
*
* @return string The timezone string of the site.
*/
public function get_timezone(): string {
return wp_timezone_string();
}
/**
* Remove the permalink shortcode from a WordPress template.
*

View file

@ -94,7 +94,7 @@ final class The_Events_Calendar extends Event {
*
* @return string status of the event
*/
public function get_tribe_status() {
public function get_status() {
if ( 'canceled' === $this->tribe_event->event_status ) {
return 'CANCELLED';
}
@ -179,4 +179,13 @@ final class The_Events_Calendar extends Event {
return $location;
}
/**
* Get the timezone of the event.
*
* @return string The timezone string of the site.
*/
public function get_timezone(): string {
return $this->tribe_event->timezone;
}
}