Skip to content

Commit

Permalink
Remove gutenberg default styles, classic theme styles and global styl…
Browse files Browse the repository at this point in the history
…es from clean up hook by default
  • Loading branch information
ronilaukkarinen committed Dec 19, 2024
1 parent 5f85472 commit 810ca5e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 3.1.10: 2024-12-19

* Fix removal of dashicons from frontend for non-admin, non-logged-in users
* Remove gutenberg default styles, classic theme styles and global styles from clean up hook by default (T-23576)

### 3.1.9: 2024-12-18

* Remove WPForms reports widget from dashboard
Expand Down
8 changes: 4 additions & 4 deletions air-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Air helper
* Plugin URI: https://github.com/digitoimistodude/air-helper
* Description: Plugin provides helpful functions and modifications for WordPress projects.
* Version: 3.1.9
* Version: 3.1.10
* Author: Digitoimisto Dude Oy
* Author URI: https://www.dude.fi
* Requires at least: 5.5
Expand All @@ -28,9 +28,9 @@
* @return integer current version of plugin
*/
function air_helper_version() {
// Version: 3.1.9
// 5 integers, e. g. 3.1.9 -> 31009
return 31009;
// Version: 3.1.10
// 5 integers, e. g. 3.1.10 -> 31010
return 31010;
} // end air_helper_version

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"plugin"
],
"license": "GPL-3.0+",
"version": "3.1.9",
"version": "3.1.10",
"authors": [
{
"name": "Timi Wahalahti",
Expand Down
13 changes: 5 additions & 8 deletions inc/clean-ups.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ function air_helper_strip_tags_menu_item( $title, $arg_2 = null, $arg_3 = null,
*/
add_action( 'wp_enqueue_scripts', 'air_helper_dequeue_default_styles', 100 );
function air_helper_dequeue_default_styles() {
if ( is_admin() || is_user_logged_in() ) {
return;
// Only disable dashicons for non-admin, non-logged-in users
if ( ! is_admin() && ! is_user_logged_in() ) {
wp_deregister_style( 'dashicons' );
}

$styles_to_deregister = apply_filters( 'air_helper_styles_to_deregister', [
'dashicons',
'wp-block-library-theme',
'classic-theme-styles',
'global-styles',
] );
// Always disable these styles regardless of user status
$styles_to_deregister = apply_filters( 'air_helper_styles_to_deregister', [] );

foreach ( $styles_to_deregister as $style ) {
wp_deregister_style( $style );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "air-helper",
"version": "3.1.9",
"version": "3.1.10",
"description": "Plugin provides helpful functions and modifications for WordPress projects.",
"main": "air-helper.php",
"dependencies": {},
Expand Down

0 comments on commit 810ca5e

Please sign in to comment.