• I’m trying to deregister the scripts on every page but the one that utilizes the map.
    I’ve tried targeting them with the function below, but to no avail.
    Is this even a possibility? If not, could it perhaps become a feature in a later version?
    Thanks.

    add_action( 'wp_print_scripts', 'deregister_map_javascript', 'contact' );
    function deregister_map_javascript() {
        if ( !is_page('contact') ) {
            wp_deregister_script( 'easy2map_js_api' );
    	wp_deregister_script( 'easy2map_js_easy2map' );
    	wp_deregister_script( 'easy2map_js_Xml2json' );
        }
    }

    https://www.ads-software.com/plugins/easy2map/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author stevenellis

    (@stevenellis)

    Hi there,

    Thanks for the message. At the moment, this is not a feature in the plugin. We will have to include this feature in a later version. Just so I understand the issue, what is the reason for you wanting to deregister the easy2map_js_api and easy2map_js_easy2map scripts?

    Thread Starter jaysecond

    (@jaysecond)

    Hi, thanks for the response. I was just looking for more control over the plugin, so I could potentially load it only on the page(s) that utilize it. Code cleanup, sort of speak.
    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deregistering scripts’ is closed to new replies.