“wp_deregister_script” and query strings

I’m using wp_deregister_script in functions.php to only load javascript files on the pages I need them.

This works great – except when the javascript is using query strings…

Read More

My code is as follows:

add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
if ( !is_page('167') ) { 
wp_deregister_script( 'iphorm' ); 
wp_deregister_script( 'iphorm-plugin' ); 
wp_deregister_script( 'jquery-form' ); 
wp_deregister_script( 'jquery-smooth-scroll' ); 
wp_deregister_script( 'qtip' );
wp_deregister_script( 'uniform' );
wp_deregister_script( 'infield-label' );
}

This works with all the js files without query strings, but files like iphorm.js?ver=1.3.5 are still loading.

Any ideas?

Related posts

Leave a Reply