Stop script from loading on all pages
-
I tried it with this code to dequeue your script and the oneclick-upsell script from woocurve (they use also stripe). Its working for woocurve but your scripts are still loading on every page. How do I have to adjust this code?
function is_handsome_checkout(){
if( get_post_type() == ‘handsome-checkout’ ){
return true;
}
return false;
}//add_action( ‘wp_enqueue_scripts’, ‘wc_dequeue_scripts’, 10 );
add_action( ‘wp_footer’, ‘wc_dequeue_scripts’, 10 );function wc_dequeue_scripts() {
if ( ! is_checkout() && ! is_account_page() && ! is_handsome_checkout() ) {
wp_dequeue_script( ‘stripe’ );
wp_dequeue_script( ‘ocustripe’ );
}
}The page I need help with: [log in to see the link]
The topic ‘Stop script from loading on all pages’ is closed to new replies.