diff --git a/inc/Engine/Saas/Admin/AdminBar.php b/inc/Engine/Saas/Admin/AdminBar.php index baea533973..72805b42a4 100644 --- a/inc/Engine/Saas/Admin/AdminBar.php +++ b/inc/Engine/Saas/Admin/AdminBar.php @@ -58,7 +58,11 @@ public function add_clean_saas_menu_item( $wp_admin_bar ) { return; } - if ( 'local' === wp_get_environment_type() ) { + if ( + 'local' === wp_get_environment_type() + && + (bool) $this->options->get( 'remove_unused_css', 0 ) + ) { return; } @@ -112,7 +116,11 @@ public function add_clean_saas_menu_item( $wp_admin_bar ) { public function add_clean_url_menu_item( WP_Admin_Bar $wp_admin_bar ) { global $post; - if ( 'local' === wp_get_environment_type() ) { + if ( + 'local' === wp_get_environment_type() + && + $this->rucss_url_context->is_allowed() + ) { return; } @@ -183,7 +191,11 @@ public function add_clean_url_menu_item( WP_Admin_Bar $wp_admin_bar ) { * @return void */ public function display_dashboard_button() { - if ( 'local' === wp_get_environment_type() ) { + if ( + 'local' === wp_get_environment_type() + && + $this->rucss_url_context->is_allowed() + ) { return; }