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) 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 ); - } }