From 993adbd203351e986b5f6ada2b41d9819ea4d871 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 26 Aug 2023 02:55:52 +0100 Subject: [PATCH] All: Disable default styles that we don't use These are newly introduced in WordPress 5.x and 6.x, as seen on the stage sites today. Removing them now so we don't add unused styles to the prod sites when we switch over to the new servers. ``` wp_dequeue_style('wp-block-library'); wp_dequeue_style('classic-theme-styles'); wp_dequeue_style('global-styles'); ``` --- themes/jquery/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/themes/jquery/functions.php b/themes/jquery/functions.php index 46595ec2..540e8486 100755 --- a/themes/jquery/functions.php +++ b/themes/jquery/functions.php @@ -14,6 +14,16 @@ $content_width = 584; } +add_action('init', function () { + // Remove unused stuff from wp_head + add_action('wp_enqueue_scripts', function () { + // Disable default styles that we don't use + wp_dequeue_style('wp-block-library'); + wp_dequeue_style('classic-theme-styles'); + wp_dequeue_style('global-styles'); + }); +}); + add_action( 'after_setup_theme', function () { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style();