• Hi there,

    I want to completely disable the maps feature, because otherwise the plugin loads a lot of CSS and JS externally from either OpenStreeMaps or Google Maps. How can I do this? Your documentation is not updated, because I can’t find the setting “Disable Google Map”: Configuring Maps (directorist.com)

    Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi

    Thank you for reaching out.

    Please use the following filter to remove the map scripts completely from your website. You can use this snippet at the end of the functions.php file of the current active theme or you can use any snippet plugin.

    add_filter('directorist_scripts', function ($scripts) {
    	unset($scripts['directorist-openstreet-map']);
    	unset($scripts['directorist-google-map']);
    	return $scripts;
    });

    Please inform us if you need further assistance.

    Kind Regards

    Thread Starter Gerard Blanco

    (@sixaxis)

    Thanks @mahfuz87!

    It works, but what if I want to do the same for CSS? I still have these loaded:

    • wp-content/plugins/directorist/assets/vendor-css/openstreet-map/openstreet.css
    • wp-content/plugins/directorist/assets/vendor-css/openstreet-map/leaflet.css
    Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hello Gerard

    Please try the following code to get rid of those css files.

    add_filter('directorist_scripts', function ($scripts) {
    	unset($scripts['directorist-openstreet-map']);
    	unset($scripts['directorist-openstreet-map-leaflet']);
    	unset($scripts['directorist-openstreet-map-openstreet']);
    	unset($scripts['directorist-google-map']);
    	return $scripts;
    });

    Please inform me if you need further assistance.

    Kind Regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to disable maps?’ is closed to new replies.