diff --git a/src/my-calendar-locations.php b/src/my-calendar-locations.php index d789a509..7cf7f744 100644 --- a/src/my-calendar-locations.php +++ b/src/my-calendar-locations.php @@ -1836,14 +1836,14 @@ function mc_default_countries( $query = '' ) { */ function mc_display_location_details( $content ) { if ( is_singular( 'mc-locations' ) && in_the_loop() && is_main_query() ) { - $location = mc_get_location_id( get_the_ID() ); - $location = mc_get_location( $location ); + $loc_id = mc_get_location_id( get_the_ID() ); + $location = mc_get_location( $loc_id ); if ( ! is_object( $location ) ) { return $content; } $args = array( - 'ltype' => 'name', - 'lvalue' => $location->location_label, + 'ltype' => 'id', + 'lvalue' => $loc_id, 'type' => 'events', 'after' => 5, 'before' => 0,