fix location for tribe

This commit is contained in:
André Menrath 2024-09-27 17:54:19 +02:00
parent e8574d26ac
commit 4db38dce15

View file

@ -136,7 +136,7 @@ final class The_Events_Calendar extends Event {
*/ */
public function get_location(): Place|null { public function get_location(): Place|null {
// Get short handle for the venues. // Get short handle for the venues.
$venues = $this->wp_object->venues; $venues = $this->tribe_event->venues;
// Get first venue. We currently only support a single venue. // Get first venue. We currently only support a single venue.
if ( $venues instanceof \Tribe\Events\Collections\Lazy_Post_Collection ) { if ( $venues instanceof \Tribe\Events\Collections\Lazy_Post_Collection ) {
@ -181,6 +181,8 @@ final class The_Events_Calendar extends Event {
$location = new Place(); $location = new Place();
if ( count( $address ) > 1 ) { if ( count( $address ) > 1 ) {
$location->set_address( $address ); $location->set_address( $address );
} else {
$location->set_address( $venue->post_title );
} }
$location->set_id( $venue->permalink ); $location->set_id( $venue->permalink );
$location->set_name( $venue->post_title ); $location->set_name( $venue->post_title );