-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add leaflet plug-in version to enquire scripts #222
Comments
In the meantime, I'm using this ...
The use of Currently your plugin breaks and we have to set it to ignore |
Due to your question I was just wondering why the minified versions are not loaded for me, even though they exist. But the code is: wp-plugin-leaflet-map/class.leaflet-map.php Lines 207 to 211 in b7fb694
and wp-plugin-leaflet-map/class.leaflet-map.php Line 218 in b7fb694
My setting WP_DEBUG is true in wp-config.php. Does it make sense to load the non-minified version when WP_DEBUG is true? There better be an option in the plugin? |
OMG I was actually going to address that in the code above :) I have WP_DEBUG on all the time because I need to know immediately if there are any issues ... so this doesn't work for me. Personally I wouldn't have done that because none of your users will want the non-minified version and probably won't realise that's what's causing it to load (as I didn't until I saw that bit of code). Perhaps you could use In the meantime, I've amended my temporary code above to ...
|
OK, and now I've worked out why using "Merge + Minify + Refresh" plugin breaks the Leaflet JS maps. It's because you have set $in_footer to true when registering the script ...
So the inline JS for each map can't find the Instead I would use this (but change null for the version of Leaflet JS) ...
So, here's the new code which puts
|
Actually, this works too (loading construct-leaflet-map.js in the footer instead of the header) ...
Basically I think both scripts need to be loaded in the header or the footer but not one in each. |
Check the PR #217 to see if that's what you're looking for |
Great. I've added a couple of comments. |
From: https://wordpress.org/support/topic/add-leaflet-version-to-enqueue-commands/
The text was updated successfully, but these errors were encountered: