diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f9fda5e1..9129e4361c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This is an alpha version! The changes listed here are not final. ### Other changes - Add Jetpack Manage banner in the Dashboard +- Admin Interface: remove exception for Import screen on Classic style - AI Proofread plugin: add feature to the event props - Fix issue where there are two Jetpack menu items that link users to Jetpack Backup - Jetpack AI: add loading state to the usage panel. diff --git a/modules/masterbar/admin-menu/class-admin-menu.php b/modules/masterbar/admin-menu/class-admin-menu.php index 606a58ab5a..1c89ef5917 100644 --- a/modules/masterbar/admin-menu/class-admin-menu.php +++ b/modules/masterbar/admin-menu/class-admin-menu.php @@ -58,7 +58,7 @@ public function reregister_menu_items() { */ public function get_preferred_view( $screen, $fallback_global_preference = true ) { $force_default_view = in_array( $screen, array( 'users.php', 'options-general.php' ), true ); - $use_wp_admin = $this->use_wp_admin_interface( $screen ); + $use_wp_admin = $this->use_wp_admin_interface(); // When no preferred view has been set for "Users > All Users" or "Settings > General", keep the previous // behavior that forced the default view regardless of the global preference. diff --git a/modules/masterbar/admin-menu/class-base-admin-menu.php b/modules/masterbar/admin-menu/class-base-admin-menu.php index cf821a629c..4d319b5057 100644 --- a/modules/masterbar/admin-menu/class-base-admin-menu.php +++ b/modules/masterbar/admin-menu/class-base-admin-menu.php @@ -82,7 +82,7 @@ protected function __construct() { add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) ); // Do not inject core mobile toggle when the user wants to use the WP Admin interface. - if ( ! $this->use_wp_admin_interface( 'jetpack' ) ) { + if ( ! $this->use_wp_admin_interface() ) { add_action( 'adminmenu', array( $this, 'inject_core_mobile_toggle' ) ); } } @@ -268,7 +268,7 @@ public function enqueue_scripts() { wp_style_add_data( 'jetpack-admin-menu', 'rtl', $this->is_rtl() ); // Load nav unification styles when the user isn't using wp-admin interface style. - if ( ! $this->use_wp_admin_interface( 'jetpack' ) ) { + if ( ! $this->use_wp_admin_interface() ) { wp_enqueue_style( 'jetpack-admin-nav-unification', plugins_url( 'admin-menu-nav-unification.css', __FILE__ ), @@ -663,7 +663,7 @@ public function get_preferred_view( $screen, $fallback_global_preference = true return self::UNKNOWN_VIEW; } - $should_link_to_wp_admin = $this->should_link_to_wp_admin( $screen ) || $this->use_wp_admin_interface( $screen ); + $should_link_to_wp_admin = $this->should_link_to_wp_admin( $screen ) || $this->use_wp_admin_interface(); return $should_link_to_wp_admin ? self::CLASSIC_VIEW : self::DEFAULT_VIEW; } @@ -779,29 +779,10 @@ public function inject_core_mobile_toggle() { /** * Whether the current user has indicated they want to use the wp-admin interface for the given screen. * - * @param string $screen The current screen. * @return bool */ - public function use_wp_admin_interface( $screen ) { - $screen_excluded = $this->is_excluded_wp_admin_interface_screen( $screen ); - return ! $screen_excluded && 'wp-admin' === get_option( 'wpcom_admin_interface' ); - } - - /** - * Returns whether we should default to wp_admin for the given screen. - * - * Screens that should not default to wp_admin when the wpcom_admin_interface is set. - * This applies to screens that have both a wp-admin and a Calypso interface. - * - * @param string $screen The current screen. - * - * @return bool - */ - protected function is_excluded_wp_admin_interface_screen( $screen ) { - $excluded_screens = array( - 'import.php', - ); - return in_array( $screen, $excluded_screens, true ); + public function use_wp_admin_interface() { + return 'wp-admin' === get_option( 'wpcom_admin_interface' ); } /**