Proper hook for W3TC defines, or dynamically disable w3 total cache [closed]

U could try using this type function:

add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    if ( !is_page('Events') ) { 
        wp_deregister_script( 'wpng-calendar' ); 
        wp_deregister_script( 'date-js' ); 
        wp_deregister_script( 'thickbox-js' ); 
        wp_deregister_script( 'jquery-js' ); 
        wp_deregister_script( 'wiky-js' ); 
     }
 }

Found it on this website

U’ll have to modify the nandlers to your needs, i found the W3TC handlers to be:

TotalCacheAdmin.php (8 hits)

Line 614:         wp_enqueue_style('w3tc-options');
Line 615:         wp_enqueue_style('w3tc-lightbox');
Line 624:         wp_enqueue_script('w3tc-metadata');
Line 625:         wp_enqueue_script('w3tc-options');
Line 626:         wp_enqueue_script('w3tc-lightbox');
Line 633:         wp_enqueue_script('jquery-ui-sortable');
Line 637:         wp_enqueue_script('jquery-ui-dialog');
Line 642:         wp_enqueue_script('w3tc-options');

Leave a Comment