mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
REST API: Fix fatal error on multisite when calling the single item plugin routes.
The `is_network_only_plugin` and `is_plugin_active` functions are not available in a front-end context and must be specifically loaded. Props oakesjosh. Fixes #52205. Built from https://develop.svn.wordpress.org/trunk@49952 git-svn-id: http://core.svn.wordpress.org/trunk@49651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ef956a1309
commit
b1f8ffa77d
@ -209,6 +209,8 @@ class WP_REST_Plugins_Controller extends WP_REST_Controller {
|
||||
* @return true|WP_Error True if can read, a WP_Error instance otherwise.
|
||||
*/
|
||||
protected function check_read_permission( $plugin ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
if ( ! $this->is_plugin_installed( $plugin ) ) {
|
||||
return new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) );
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7-alpha-49951';
|
||||
$wp_version = '5.7-alpha-49952';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user