From e6e96d0ef9ae9a0f7ce8a502193a59a58f56aa63 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 18 Jul 2019 01:32:13 +0000 Subject: [PATCH] Editor: Replace external Classic Editor plugin URL with a link to Add Plugins screen with Classic Editor pre-selected. This applies to messages displayed when JavaScript is disabled in Block Editor, or an incompatible meta box is used. Props garrett-eclipse, derweili, afercia. Fixes #47487. git-svn-id: https://develop.svn.wordpress.org/trunk@45657 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 4 ++-- src/wp-admin/includes/template.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 60f44edee9..baed3ba9b3 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -415,9 +415,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );

Classic Editor plugin.' ), - __( 'https://wordpress.org/plugins/classic-editor/' ) + esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) ) ); /** diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 6c83001e9a..9c6a48d019 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -1109,8 +1109,11 @@ function do_block_editor_incompatible_meta_box( $object, $box ) { if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) { if ( current_user_can( 'install_plugins' ) ) { echo '

'; - /* translators: %s: A link to install the Classic Editor plugin. */ - printf( __( 'Please install the Classic Editor plugin to use this meta box.' ), esc_url( self_admin_url( 'plugin-install.php?tab=featured' ) ) ); + printf( + /* translators: %s: A link to install the Classic Editor plugin. */ + __( 'Please install the Classic Editor plugin to use this meta box.' ), + esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) ) + ); echo '

'; } } elseif ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {