bozdoz / wp-plugin-leaflet-map

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

adds 'leaflet_map_popup_message' filter #211

Closed bozdoz closed 1 year ago

bozdoz commented 1 year ago

What do you think @yonkov

yonkov commented 1 year ago

@bozdoz , thank you, I tested it. This looks like a good approach, however 2 more things need to be updated for the lightbox to work: when I comment out line 384 and change line 394 to interpolation commas: Screenshot

384: //$message = addslashes($message); 394: echo "{$shape}.bindPopup(`{$message}`)";

hupe13 commented 1 year ago

@yonkov , it's good that you made a comment. I could not decide whether it fits or not.

bozdoz commented 1 year ago

@yonkov backticks are a whole different conversation.

So your plugin must be filling in js variables; otherwise, I have no idea why backticks are working.

This just seems like such a one-off solution to a specific problem.

yonkov commented 1 year ago

@bozdoz , this is now working!!! Many thanks!!! : )))

https://user-images.githubusercontent.com/26258032/221435381-084a04ea-cab3-40d9-8c10-793bb20e110e.mp4

I used the exact code snippet you suggested, returning the shortcoded variable. The styling issues are also resolved. Great work, i will leave a 5-star review in wp.org.