From 61986acde9680b2e987635992919ff44ea8077d2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 17 Feb 2020 05:33:06 +0000 Subject: [PATCH] Users: Limit the scope of admin files required in `WP_REST_Users_Controller`. This requires only `wp-admin/includes/user.php` for `get_editable_roles()`, instead of `wp-admin/includes/admin.php`. Follow-up to [43589]. Props johnwatkins0. Fixes #49450. Built from https://develop.svn.wordpress.org/trunk@47299 git-svn-id: http://core.svn.wordpress.org/trunk@47099 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-users-controller.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index e8d4b5c09c..83979c2891 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -1210,8 +1210,8 @@ class WP_REST_Users_Controller extends WP_REST_Controller { ); } - // Include admin functions to get access to get_editable_roles(). - require_once ABSPATH . 'wp-admin/includes/admin.php'; + // Include user admin functions to get access to get_editable_roles(). + require_once ABSPATH . 'wp-admin/includes/user.php'; // The new role must be editable by the logged-in user. $editable_roles = get_editable_roles(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 45f78519ec..87fc2ebf8a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta1-47298'; +$wp_version = '5.4-beta1-47299'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.