wp event manager: small improvements
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 42s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m9s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m11s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m0s

This commit is contained in:
André Menrath 2024-10-09 18:03:02 +02:00
parent 8069f747b4
commit 58b0cc44a3

View file

@ -48,13 +48,18 @@ final class WP_Event_Manager extends Event_Transformer {
* @return array The Place. * @return array The Place.
*/ */
public function get_location(): ?Place { public function get_location(): ?Place {
$location = new Place();
$location_name = get_post_meta( $this->wp_object->ID, '_event_online', true ); $location_name = get_post_meta( $this->wp_object->ID, '_event_online', true );
if ( $location_name ) {
$location = new Place();
$location->set_name( $location_name ); $location->set_name( $location_name );
$location->set_sensitive( null ); $location->set_sensitive( null );
$location->set_address( $location_name ); $location->set_address( $location_name );
return $location; return $location;
} }
return null;
}
/** /**
* Get the end time from the events metadata. * Get the end time from the events metadata.