WordPress.org

Make WordPress Core

Changeset 47299


Ignore:
Timestamp:
02/17/2020 05:31:18 AM (7 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r47298 r47299  
    12111211            }
    12121212
    1213             // Include admin functions to get access to get_editable_roles().
    1214             require_once ABSPATH . 'wp-admin/includes/admin.php';
     1213            // Include user admin functions to get access to get_editable_roles().
     1214            require_once ABSPATH . 'wp-admin/includes/user.php';
    12151215
    12161216            // The new role must be editable by the logged-in user.
Note: See TracChangeset for help on using the changeset viewer.