Skip to content

Commit

Permalink
Switch location query to use ID instead of label.
Browse files Browse the repository at this point in the history
ID is much more reliable as a reference.
  • Loading branch information
joedolson committed Oct 6, 2024
1 parent 7775c2e commit 61bf30d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/my-calendar-locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 61bf30d

Please sign in to comment.