Optimization with deregister and dequeue
-
Hi, can you help me with this problem.
I want to optimize my website by removing these js and css from certain pages. Usually this code works, but not this time.function unregister_non_woocommerce_styles_scripts() { error_log('Funkcja unregister_non_woocommerce_styles_scripts zosta?a wywo?ana'); // Sprawd?, czy to nie jest strona WooCommerce // if ( !is_woocommerce() && !is_cart() && !is_checkout() ) { // Wyrejestruj CSS wp_deregister_style('eb-pro-sso-public-style-css'); wp_deregister_style('eb-pro-woo-int-public-css-css'); wp_deregister_style('dashicons-css'); wp_deregister_style('edwiserbridge_font_awesome-css'); wp_deregister_style('edwiserbridge-css'); wp_deregister_style('wdmdatatablecss-css'); wp_deregister_style('eb-public-jquery-ui-css-css'); // Wyrejestruj JS wp_dequeue_script('cookie-law-info-ccpa-js'); wp_dequeue_script('eb-pro-sso-public-script-js'); wp_dequeue_script('eb-pro-woo-int-public-js-js'); wp_dequeue_script('jquery-ui-core-js'); wp_dequeue_script('jquery-ui-mouse-js'); wp_dequeue_script('jquery-ui-resizable-js'); wp_dequeue_script('jquery-ui-draggable-js'); wp_dequeue_script('jquery-ui-controlgroup-js'); wp_dequeue_script('jquery-ui-checkboxradio-js'); wp_dequeue_script('jquery-ui-button-js'); wp_dequeue_script('jquery-ui-dialog-js'); wp_dequeue_script('edwiserbridge-js'); wp_dequeue_script('edwiserbridge-ui-block-js'); wp_dequeue_script('wdmdatatablejs-js'); // } } add_action('wp_enqueue_scripts', 'unregister_non_woocommerce_styles_scripts', 100);
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Optimization with deregister and dequeue’ is closed to new replies.