gmw_current_location displays the visitor's location and supported controls to update it. It uses GEO my WP's current-location state, not a post/member's saved directory location.
[gmw_current_location elements="address,map,location_form" address_fields="city,country"]
Output elements
elements is a comma-separated ordered list. Supported core elements are username, address, map and location_form. All four are included by default. Address and map appear only when a current location exists; the location form can still let visitors provide one.
Labels and location form
Use update_location_label, clear_location_label, address_label, address_field_placeholder and loading_message to adjust the text. user_greeting introduces a signed-in display name; guest_greeting supplies the guest greeting.
address_autocomplete enables supported address suggestions. Its default is 1. It still depends on the provider and credentials. Browser location detection needs permission and an appropriate secure context; the manual address field is useful when detection is denied.
Address fields
address_fields defaults to city,country. Use supported saved current-location properties separated by commas. The aliases state and country use region/country codes. Choose only the level of detail needed for this visitor-facing display.
Map appearance
map_width defaults to 100%, map_height to 250px, map_type to ROADMAP and zoom_level to 8. scrollwheel_zoom and expand_on_load control supported interaction/expanded presentation.
map_icon_url supplies an icon URL and map_icon_size supplies comma-separated dimensions. These do not change the underlying detected coordinates. Map features remain provider-dependent.
Updates and instance identity
element_id identifies this instance; use different values for multiple instances. ajax_update defaults to 0. The current implementation disables AJAX update when no location exists, so do not assume that enabling it eliminates every page refresh, particularly for the first lookup.
Use the current label attributes rather than deprecated location_form_trigger/clear_location_trigger names. Do not enable use_generic_location on a real visitor display: it supplies sample/editor data rather than the visitor's location.
Test the location states
- Open the actual frontend without a known current location.
- Enter a safe test address manually and confirm the address/map.
- Test the available browser locator with permission accepted and denied.
- Clear or update the current location and confirm the result.
- Check signed-in/guest greetings and phone layout.
Updating the current location does not geotag a directory listing or update a member's permanent location. Those use their own location forms.
