REST API: Use consistent error messages when managing network plugins.

Props ramiy.
Fixes #50729.
Built from https://develop.svn.wordpress.org/trunk@48556


git-svn-id: http://core.svn.wordpress.org/trunk@48318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-07-21 22:01:03 +00:00
parent 16784a5ea7
commit 5323fa05e5
2 changed files with 2 additions and 2 deletions

View File

@ -640,7 +640,7 @@ class WP_REST_Plugins_Controller extends WP_REST_Controller {
if ( is_multisite() && ( 'network-active' === $current_status || 'network-active' === $new_status ) && ! current_user_can( 'manage_network_plugins' ) ) { if ( is_multisite() && ( 'network-active' === $current_status || 'network-active' === $new_status ) && ! current_user_can( 'manage_network_plugins' ) ) {
return new WP_Error( return new WP_Error(
'rest_cannot_manage_network_plugins', 'rest_cannot_manage_network_plugins',
__( 'Sorry, you do not have permission to manage network plugins.' ), __( 'Sorry, you are not allowed to manage network plugins.' ),
array( 'status' => rest_authorization_required_code() ) array( 'status' => rest_authorization_required_code() )
); );
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-beta3-48555'; $wp_version = '5.5-beta3-48556';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.