Description
This filter allows you to change the default options for the map shortcode.
Parameters
$shortcode_defaults - (array) The current defaults for the [wpsl_map]
shortcode.
The available shortcode attributes:
Attribute | Value |
---|---|
id | The 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. |
width | The width of the map in pixels. If no value is set, it will default to 100%. |
height | The height of the map in pixels. |
zoom | A number between 1 and 21. |
map_type | Roadmap, satellite, hybrid and terrain. |
map_type_control | 0 or 1 |
map_style | If 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_view | 0 or 1 |
pan_controls | 0 or 1 |
scrollwheel | 0 or 1 |
control_position | Left or right |
control_style | Small 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.
Usage
This example sets the width of the map to 800px and the height to 500px:
Changelog
Since 2.0
Source File
This filter is located in /frontend/class-frontend.php.
Placement
The code needs to be placed in the functions.php file inside your active theme folder.