From 2d35a7fb3f00f0a7ec500b655b4ec6efc4e9cbd5 Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Fri, 17 Jan 2025 17:47:49 +0530 Subject: [PATCH 1/2] remove calypso notice from general settings --- .../admin-menu/class-atomic-admin-menu.php | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/projects/packages/masterbar/src/admin-menu/class-atomic-admin-menu.php b/projects/packages/masterbar/src/admin-menu/class-atomic-admin-menu.php index 2a723cc124ac2..0bcafb72c30b7 100644 --- a/projects/packages/masterbar/src/admin-menu/class-atomic-admin-menu.php +++ b/projects/packages/masterbar/src/admin-menu/class-atomic-admin-menu.php @@ -45,11 +45,6 @@ function () { }, 0 ); - - // Add notices to the settings pages when there is a Calypso page available. - if ( $this->use_wp_admin_interface() ) { - add_action( 'current_screen', array( $this, 'add_settings_page_notice' ) ); - } } /** @@ -530,55 +525,4 @@ public function wp_ajax_jitm_dismiss() { } wp_die(); } - - /** - * Adds a notice above each settings page while using the Classic view to indicate - * that the Default view offers more features. Links to the default view. - * - * @return void - */ - public function add_settings_page_notice() { - if ( ! is_admin() ) { - return; - } - - $current_screen = get_current_screen(); - - if ( ! $current_screen instanceof \WP_Screen ) { - return; - } - - // Show the notice for the following screens and map them to the Calypso page. - $screen_map = array( - 'options-general' => 'general', - 'options-reading' => 'reading', - ); - - $mapped_screen = $screen_map[ $current_screen->id ] ?? false; - - if ( ! $mapped_screen ) { - return; - } - - $switch_url = sprintf( 'https://wordpress.com/settings/%s/%s', $mapped_screen, $this->domain ); - - // Close over the $switch_url variable. - $admin_notices = function () use ( $switch_url ) { - wp_admin_notice( - wp_kses( - sprintf( - // translators: %s is a link to the Calypso settings page. - __( 'You are currently using the Classic view, which doesn’t offer the same set of features as the Default view. To access additional settings and features, switch to the Default view. ', 'jetpack-masterbar' ), - esc_url( $switch_url ) - ), - array( 'a' => array( 'href' => array() ) ) - ), - array( - 'type' => 'warning', - ) - ); - }; - - add_action( 'admin_notices', $admin_notices ); - } } From f16d62068655ddb7397d0bcbf065f78d55b572ad Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Fri, 17 Jan 2025 17:51:51 +0530 Subject: [PATCH 2/2] changelog --- .../packages/masterbar/changelog/remove-classic-view-notice | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/packages/masterbar/changelog/remove-classic-view-notice diff --git a/projects/packages/masterbar/changelog/remove-classic-view-notice b/projects/packages/masterbar/changelog/remove-classic-view-notice new file mode 100644 index 0000000000000..c67067aa466a4 --- /dev/null +++ b/projects/packages/masterbar/changelog/remove-classic-view-notice @@ -0,0 +1,4 @@ +Significance: minor +Type: removed + +removed classic view admin notice from general settings (for atomic sites)