1. Description
  2. Parameters
  3. Usage
  4. Changelog
  5. Source File
  6. Related


This filter allows you to change the default options for the map shortcode.


$shortcode_defaults - (array) The current defaults for the [wpsl_map] shortcode.

The available shortcode attributes:

idThe id of the store that you want to show on the map. This is only required if you use this shortcode on a page that isn't a store location page.
widthThe width of the map in pixels. If no value is set, it will default to 100%.
heightThe height of the map in pixels.
zoomA number between 1 and 21.
map_typeRoadmap, satellite, hybrid and terrain.
map_type_control0 or 1
map_styleIf you have set a custom map style on the settings page and you want to disable it on the individual maps, you should set this to default.
street_view0 or 1
pan_controls0 or 1
scrollwheel0 or 1
control_positionLeft or right
control_styleSmall or large
The default values for the id, width and map_style are set to empty. All the other default values are based on the settings from the settings page for the store locator map.


This example sets the width of the map to 800px and the height to 500px:


Since 2.0

Source File

This filter is located in /frontend/class-frontend.php.


The code needs to be placed in the functions.php file inside your active theme folder.