From 62729e05bdfe78eec117514c55e7fd0fd400a205 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/inc/class-whitelabel.php b/inc/class-whitelabel.php index 6cf4a75..76c5370 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,9 +85,6 @@ 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)) { @@ -291,6 +288,7 @@ class Whitelabel { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); + $this->enqueue_styles(); } /**