From 7898fbec964cbefef5d54e5f1999c3935c678a7e Mon Sep 17 00:00:00 2001 From: Jon Christopher Date: Wed, 8 May 2019 18:40:38 -0400 Subject: [PATCH] Removes notice after upgrade (#96) Remove the after-upgrade notice from the "What's New" screen. Fixes #95. --- classic-editor.php | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/classic-editor.php b/classic-editor.php index 0b1a556..afac3c2 100644 --- a/classic-editor.php +++ b/classic-editor.php @@ -115,8 +115,6 @@ public static function init_actions() { } if ( $block_editor ) { - // Show warning on the "What's New" screen (about.php). - add_action( 'all_admin_notices', array( __CLASS__, 'notice_after_upgrade' ) ); // Move the Privacy Page notice back under the title. add_action( 'admin_init', array( __CLASS__, 'on_admin_init' ) ); } @@ -508,44 +506,6 @@ public static function save_network_settings() { } } - public static function notice_after_upgrade() { - global $pagenow; - $settings = self::get_settings(); - - if ( - $pagenow !== 'about.php' || - $settings['hide-settings-ui'] || - $settings['editor'] === 'block' || - $settings['allow-users'] || - ! current_user_can( 'edit_posts' ) - ) { - // No need to show when the user cannot edit posts, - // the settings are preset from another plugin, - // or when not replacing the Block Editor. - return; - } - - $message = __( 'The Classic Editor plugin prevents use of the new Block Editor.', 'classic-editor' ); - - if ( current_user_can( 'manage_options' ) ) { - if ( is_network_admin() ) { - $url = 'settings.php#classic-editor-options'; - } else { - $url = 'options-writing.php#classic-editor-options'; - } - - $message .= ' ' . sprintf( __( 'Change the %1$sClassic Editor settings%2$s.', 'classic-editor' ), sprintf( '', $url ), '' ); - } - - $margin = is_rtl() ? 'margin: 1em 0 0 160px;' : 'margin: 1em 160px 0 0;'; - - ?> -
-

-
-