From 3113413c3d2dfda8706c813d80124ae820320b67 Mon Sep 17 00:00:00 2001 From: David Stone Date: Sat, 15 Feb 2025 09:36:25 -0700 Subject: [PATCH] Only enqueue style when needed --- inc/class-whitelabel.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/inc/class-whitelabel.php b/inc/class-whitelabel.php index 6cf4a75..9e5663e 100644 --- a/inc/class-whitelabel.php +++ b/inc/class-whitelabel.php @@ -61,7 +61,7 @@ class Whitelabel { */ public function init(): void { - add_action('wp_ultimo_load', [$this, 'add_settings'], 20); + add_action('init', [$this, 'add_settings'], 20); add_action('admin_init', [$this, 'clear_footer_texts']); @@ -85,12 +85,9 @@ class Whitelabel { add_action('wp_dashboard_setup', [$this, 'remove_dashboard_widgets'], 11); - add_action('admin_enqueue_scripts', [$this, 'enqueue_styles']); - - add_action('wp_enqueue_scripts', [$this, 'enqueue_styles']); } - if (wu_get_setting('hide_sites_menu', true)) { + if (wu_get_setting('hide_sites_menu', tenqueue_stylesrue)) { add_action('network_admin_menu', [$this, 'remove_sites_admin_menu']); } } @@ -291,6 +288,7 @@ class Whitelabel { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); + $this->enqueue_styles(); } /**