fix location for tribe
All checks were successful
All checks were successful
This commit is contained in:
parent
e8574d26ac
commit
4db38dce15
1 changed files with 3 additions and 1 deletions
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue