Compare commits

...

4 commits

Author SHA1 Message Date
c8eedafb13 add status to tribe
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 36s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m2s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m1s
2024-09-29 11:02:44 +02:00
1153bce8e2 fix tags being in nested arrays
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 38s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 57s
2024-09-28 23:05:42 +02:00
4ff31c6b45 add timezone for the events calendar
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 52s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m29s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m34s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m27s
2024-09-28 19:52:48 +02:00
d7c4f5ae39 set site timezone as default in event base transformer
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 34s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 57s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 55s
2024-09-28 16:49:39 +02:00
2 changed files with 24 additions and 2 deletions

View file

@ -276,6 +276,16 @@ abstract class Event extends Post {
return $template; return $template;
} }
/** 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();
}
/** /**
* Generic function that converts an WP-Event object to an ActivityPub-Event object. * Generic function that converts an WP-Event object to an ActivityPub-Event object.
* *

View file

@ -65,7 +65,7 @@ final class The_Events_Calendar extends Event {
$tags[] = $tag; $tags[] = $tag;
} }
} }
$tags[] = parent::get_tag(); $tags = array_merge( $tags, parent::get_tag() );
return $tags; return $tags;
} }
@ -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_tribe_status() { public function get_status() {
if ( 'canceled' === $this->tribe_event->event_status ) { if ( 'canceled' === $this->tribe_event->event_status ) {
return 'CANCELLED'; return 'CANCELLED';
} }
@ -193,10 +193,22 @@ final class The_Events_Calendar extends Event {
} }
$location->set_id( $venue->permalink ); $location->set_id( $venue->permalink );
$location->set_name( $venue->post_title ); $location->set_name( $venue->post_title );
$location->set_sensitive( null );
return $location; return $location;
} }
/** 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 $this->tribe_event->timezone;
}
/** /**
* Extend the default event transformers to_object function. * Extend the default event transformers to_object function.
* *