I’ve found that this seems to be done in
event-organiser-register.php
wp_register_style( 'eo-leaflet.js', "{$protocal}cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css" );
What happens, when I delete this registration? Is it necessary to reinstall event organiser?
I might have a solution! : )
leaflet is used for OpenStreetMaps. It can also be downloaded here:
https://leafletjs.com/
When I extract and copy the latest version to a new folder in “event-organiser” on my webserver and change event-organiser-register.php to
wp_register_script( 'eo-leaflet.js', EVENT_ORGANISER_URL."NEW-FOLDER/leaflet.js" );
wp_register_style( 'eo-leaflet.js', EVENT_ORGANISER_URL."NEW-FOLDER/leaflet.css" );
(you have to replace NEW-FOLDER) then everything works perfectly fine without any external sources. You also don’t have to reinstall anything.
I guess EO updates may override this, but for now I’m happy with this solution.
Thanks for the great Plugin.
Hi Stefan,
I’m interested in your experience with leaflet. Have you ever thought about styling your maps? I’m trying to change some aspects on my maps, in particular the scrolling zoom and the colors, but I don’t know how to proceed. If you have any experience on this, it will be really nice if you can point me in the right direction.
Dear stefandog,
I have been playing around a little bit. By the moment, I can tell you something that can be avoid overriding your development with futur eo updates.
I done this by following this thread: https://wordpress.stackexchange.com/questions/160249/change-src-from-wp-register-script-in-plugins-themes
You can add a piece of code in your child functions.php or like me, in a mini-plugin that I created in order to adapt EO to my use.
function mylocal_leaflet() {
wp_deregister_script( 'eo-leaflet.js');
wp_register_script( 'eo-leaflet.js', 'http://localhost:8888/test/wp-content/plugins/event-organiser-myway/leaflet/leaflet.js' );
add_action('wp_enqueue_scripts', 'mylocal_leaflet');
}
Thank you both! This is very useful as it is unfortunately an issue for compatibility with the GDPR (unless one mentions it in the data protection guidelines of the website).
There are in fact multiple occurences to deregister:
event-organiser/includes/event-organiser-register.php: wp_register_style( 'eo-leaflet.js', "{$protocal}cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css" );
event-organiser/includes/event-organiser-register.php: wp_register_script( 'eo-leaflet.js', "{$protocal}cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js" );
event-organiser/includes/event-organiser-register.php: wp_register_style( 'eo-leaflet.js', "{$protocal}cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css" );
In my case, I want to entirely disable the map. So besides editing the two templates (event-meta-event-single.php and taxonomy-event-venue.php), I added to functions.php of my theme the following lines:
// disable loading the leaflet library from cloudflare for OSM in Event Organizer
function disable_loading_leaflet() {
wp_deregister_script('eo-leaflet.js');
wp_deregister_style('eo-leaflet.css');
wp_deregister_style('eo-leaflet.js');
}
add_action('wp_enqueue_scripts', 'disable_loading_leaflet');
-
This reply was modified 7 years, 1 month ago by
curlybracket.