The Open User Map plugin provides several Shortcodes to display locations, filter content, and customize the map’s appearance and functionality.
👉 You can find a list of the currently available Shortcodes and their attributes for your plugin version in the plugin settings ( Open User Map > Settings > Help & Getting Started ).
This guide outlines the available Shortcodes and their attributes.
Basic Shortcode for Displaying the Map
To display the map with all locations, use the following shortcode:
[open-user-map]
If integrating into a theme file, use:
<?php echo do_shortcode('[open-user-map]'); ?>
This will display the default map as configured in the plugin settings.
Shortcode Attributes
Map Position & View
Customize the map’s initial position and zoom level:
Attribute | Example | Description |
---|---|---|
lat | lat="51.50665" | Set latitude for the initial map position. |
long | long="-0.12752" | Set longitude for the initial map position. |
zoom | zoom="13" | Define the initial zoom level. |
region | region="Europe" | Pre-select a region (must be enabled in settings). |
Content Filtering
Filter the displayed locations based on categories, users, or specific IDs:
Attribute | Example | Description |
---|---|---|
types | types="food" types="food|drinks|hotel" | Filter locations by types (Marker Categories). Separate multiple types with a | symbol. |
ids | ids="123" ids="123|456|789" | Filter locations by Post ID. Separate multiple IDs with a | symbol. |
user (PRO) | user="current" user="123" user="role:subscriber" | Filter locations by user. Use “current” to show only locations from the currently logged-in user, a specific user ID, or “role:rolename” to show locations from users with a specific role. |
Display & Appearance
Customize the map’s size and layout:
Attribute | Example | Description |
---|---|---|
size | size="default" size="fullwidth" | Set a custom map size for desktop. |
size_mobile | size_mobile="square" size_mobile="landscape" | Set a custom size for mobile view. |
height | height="400px" | Define a custom height for desktop (include units like px). |
height_mobile | height_mobile="300px" | Define a custom height for mobile. |
map_type | map_type="interactive" map_type="simple" | Enable or disable the “Add location” button. |
map_style | map_style="Esri.WorldStreetMap" | Override the default map style. |
Features & Controls
Enable or disable specific map features:
Attribute | Example | Description |
---|---|---|
disable_regions | disable_regions="true" disable_regions="false" | Enable or disable Regions. |
enable_cluster | enable_cluster="true" enable_cluster="false" | Enable or disable marker clustering. |
enable_searchbar | enable_searchbar="true" enable_searchbar="false" | Enable or disable the searchbar. |
enable_searchaddress_button | enable_searchaddress_button="true" enable_searchaddress_button="false" | Enable or disable the “Search for Address (Geosearch)” button. |
enable_searchmarkers_button | enable_searchmarkers_button="true" enable_searchmarkers_button="false" | Enable or disable the “Search for Markers” button. |
enable_currentlocation | enable_currentlocation="true" enable_currentlocation="false" | Enable or disable the “Show me where I am” button. |
enable_fullscreen | enable_fullscreen="true" enable_fullscreen="false" | Enable or disable the fullscreen mode. |
Complete Examples
Example 1: Map of London Showing Only Food Locations
[open-user-map lat="51.50665" long="-0.12752" zoom="13" types="food" size="fullwidth" height="500px"]
Example 2: Simple Map Showing Only the Current User’s Locations (PRO)
[open-user-map map_type="simple" user="current" enable_fullscreen="true" enable_searchbar="false"]
Example 3: Interactive Map for a Specific Region with Custom Appearance
[open-user-map region="Europe" map_type="interactive" height="600px" enable_cluster="false" enable_currentlocation="true"]
Additional Shortcodes
Display Specific Location Data
The [open-user-map-location]
shortcode allows you to display details from a specific location.
Usage
[open-user-map-location value="title" post_id="12345"]
Available Values
title
image
audio
video
type
map
address
lat
lng
route
text
notification
author_name
author_email
wp_author_id
- Custom fields (Use the field label)
If post_id
is omitted, it will use the current post.
Display a Location Image Gallery
The [open-user-map-gallery]
shortcode generates a gallery of location images.
Available Attributes
Attribute | Example | Description |
---|---|---|
url | url="https://mysite.com/" | Link the images to another page. |
number | number="10" | Limit the number of displayed images. |
user | user="current" user="123" user="role:subscriber" | Filter images by user. Accepts “current”, a user ID, or “role:rolename”. |
Example Usage
[open-user-map-gallery number="10" user="current"]
Display a List of Locations
The [open-user-map-list]
shortcode generates a paginated list of locations.
Available Attributes
Attribute | Example | Description |
---|---|---|
user | user="current" | Filter locations by user. Accepts “current”, a user ID, or “role:rolename”. |
types | types="food|drinks" | Filter by marker categories. Separate multiple types with a | symbol. |
ids | ids="123|456" | Filter by location IDs. Separate multiple IDs with a | symbol. |
Example Usage
[open-user-map-list user="current" types="food|drinks"]
Summary
The Open User Map plugin provides flexible shortcodes for displaying and filtering maps, customizing layouts, and adding extra features like galleries and location lists. Use the attributes outlined above to tailor the output to your needs.
For additional customization, explore the plugin settings under Open User Map > Settings in your WordPress dashboard. 🚀