Pass geojson source as a variable in shortcode?
-
Short version: is there a clever way to pass the source url of a geojson file to the Leaflet plugin as a variable or nested shortcode rather than a hard-encoded URL? For instance rather than
[leaflet-geojson src="/path/to/file"]
is there a way to do something like
[leaflet-geojson src=[my-geojson-shortcode]]
Longer version:
I’ve got a custom post type that I created with ACF called “Routes”. Each route has and ACF “file” type field where I can upload the geojson associated with a route. I’ve selected the option to have ACF return the full file path (e.g. https://mysite.com/path.to.file.geojson) when the field is referenced.
I’m trying to create a template with Divi so that each route page will display a map with the geojson data. Therefore, I’m looking for a way to call the geojson data with some sort of placeholder. Are there any work-arounds within the leaflet-geojson shortcode that would allow me to do something like this?
- The topic ‘Pass geojson source as a variable in shortcode?’ is closed to new replies.