Skip to content

Commit

Permalink
All: Disable default styles that we don't use
Browse files Browse the repository at this point in the history
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');
```
  • Loading branch information
Krinkle committed Aug 26, 2023
1 parent d900378 commit 993adbd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions themes/jquery/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 993adbd

Please sign in to comment.