Deregistering scripts
-
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' ); } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Deregistering scripts’ is closed to new replies.