First, you're attempting to deregister too late. You need to use wp_enqueue_scripts
, rather than wp_print_scripts
.
Second, all you need to do is add a call to wp_deregister_script()
for each script you need to deregister:
<?php
add_action( 'wp_enqueue_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
if ( !is_page(array('order', 'shopping-cart', 'checkout') ) ) {
wp_deregister_script( 'tcp_scripts' );
// If you need to deregister more scripts when
// this same conditional is true, just add them here
wp_deregister_script( 'some-script' );
wp_deregister_script( 'some-other-script' );
}
// If you need to deregister other scripts generally,
// just do so here, outside the conditional:
wp_deregister_script( 'some-third-script' );
wp_deregister_script( 'some-fourth-script' );
}
?>