From 2f48ff68f3ade46e250800a313d40ef507ffd70e Mon Sep 17 00:00:00 2001 From: Griffith Chen Date: Fri, 26 Jan 2024 14:43:57 +0800 Subject: [PATCH] Untangle: Do not add the dashboard switcher for the wp-admin interface (#35210) --- .../changelog/update-untangle-dashboard-switcher | 4 ++++ .../masterbar/admin-menu/class-atomic-admin-menu.php | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 projects/plugins/jetpack/changelog/update-untangle-dashboard-switcher diff --git a/projects/plugins/jetpack/changelog/update-untangle-dashboard-switcher b/projects/plugins/jetpack/changelog/update-untangle-dashboard-switcher new file mode 100644 index 0000000000000..d9adfdd12d7c2 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-untangle-dashboard-switcher @@ -0,0 +1,4 @@ +Significance: minor +Type: other + +Remove the dashboard swither for the wp-admin interface. diff --git a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php index 4cb89afe9f37b..f34c5eb0e910f 100644 --- a/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php +++ b/projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php @@ -533,4 +533,16 @@ public function add_appearance_menu() { parent::add_appearance_menu(); } } + + /** + * Adds a dashboard switcher to the list of screen meta links of the current page. + */ + public function add_dashboard_switcher() { + // When the interface is set to wp-admin, do not show the dashboard switcher. + if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { + return; + } + + parent::add_dashboard_switcher(); + } }