set timezone and status for tribe
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 43s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m7s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m5s

This commit is contained in:
André Menrath 2024-10-02 19:49:46 +02:00
parent 972fcbb2db
commit ced5ee90b1
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;
}
}