bozdoz / wp-plugin-leaflet-map

Add leaflet maps to Wordpress with shortcodes
https://wordpress.org/plugins/leaflet-map/
GNU General Public License v2.0
141 stars 72 forks source link

Try to support custom variable db options in admin #118

Open bozdoz opened 3 years ago

bozdoz commented 3 years ago

The idea is to have both key and value as textboxes (likely in a "custom variable" section). Where the user can add as many as they'd like.


| key | value | | your-key | your-value |

and use it, for example:

[leafet-marker svg path="{ your-key | custom }"]

This could be parsed with the liquid function in https://github.com/bozdoz/wp-plugin-leaflet-map/blob/master/class.leaflet-map.php#L383

See how the map shortcode is currently implementing a 'raw' liquid-like tag: https://github.com/bozdoz/wp-plugin-leaflet-map/blob/master/shortcodes/class.map-shortcode.php#L193-L195