Fix location for tribe (#36)
Updates did not work. Always use the tribe_event instead of the wp_object where ever possible! Reviewed-on: Event-Federation/wordpress-activitypub-event-extensions#36 Co-authored-by: André Menrath <andre.menrath@posteo.de> Co-committed-by: André Menrath <andre.menrath@posteo.de>
This commit is contained in:
parent
e8574d26ac
commit
7ab51b104e
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