Powrót do Dev Notes

usunięcie dodanych inline styli w WP 6.x

w pliku functions.php dodajemy kod:


//Remove Block Library CSS from loading on the frontend
function nws_remove_wp_block_library(){
  wp_dequeue_style( 'global-styles' ); // Remove theme.json
  wp_deregister_style( 'global-styles' );
  wp_dequeue_style( 'wp-block-library' );
  wp_dequeue_style( 'wp-block-library-theme' );
  wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS
}
add_action( 'wp_enqueue_scripts', 'nws_remove_wp_block_library', 100 );

remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );