| [ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Users_Controller class
| File Size: | 1611 lines (47 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_REST_Users_Controller:: (27 methods):
__construct()
register_routes()
check_reassign()
get_items_permissions_check()
get_items()
get_user()
get_item_permissions_check()
get_item()
get_current_item()
create_item_permissions_check()
create_item()
update_item_permissions_check()
update_item()
update_current_item_permissions_check()
update_current_item()
delete_item_permissions_check()
delete_item()
delete_current_item_permissions_check()
delete_current_item()
prepare_item_for_response()
prepare_links()
prepare_item_for_database()
check_role_update()
check_username()
check_user_password()
get_item_schema()
get_collection_params()
Class: WP_REST_Users_Controller - X-Ref
Core class used to manage users via the REST API.| __construct() X-Ref |
| Constructor. since: 4.7.0 |
| register_routes() X-Ref |
| Registers the routes for users. since: 4.7.0 |
| check_reassign( $value, $request, $param ) X-Ref |
| Checks for a valid value for the reassign parameter when deleting users. The value can be an integer, 'false', false, or ''. return: int|bool|WP_Error since: 4.7.0 param: int|bool $value The value passed to the reassign parameter. param: WP_REST_Request $request Full details about the request. param: string $param The parameter that is being sanitized. |
| get_items_permissions_check( $request ) X-Ref |
| Permissions check for getting all users. return: true|WP_Error True if the request has read access, otherwise WP_Error object. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| get_items( $request ) X-Ref |
| Retrieves all users. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| get_user( $id ) X-Ref |
| Get the user, if the ID is valid. return: WP_User|WP_Error True if ID is valid, WP_Error otherwise. since: 4.7.2 param: int $id Supplied ID. |
| get_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to read a user. return: true|WP_Error True if the request has read access for the item, otherwise WP_Error object. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| get_item( $request ) X-Ref |
| Retrieves a single user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| get_current_item( $request ) X-Ref |
| Retrieves the current user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| create_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access create users. return: true|WP_Error True if the request has access to create items, WP_Error object otherwise. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| create_item( $request ) X-Ref |
| Creates a single user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| update_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to update a user. return: true|WP_Error True if the request has access to update the item, WP_Error object otherwise. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| update_item( $request ) X-Ref |
| Updates a single user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| update_current_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to update the current user. return: true|WP_Error True if the request has access to update the item, WP_Error object otherwise. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| update_current_item( $request ) X-Ref |
| Updates the current user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| delete_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access delete a user. return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| delete_item( $request ) X-Ref |
| Deletes a single user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| delete_current_item_permissions_check( $request ) X-Ref |
| Checks if a given request has access to delete the current user. return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| delete_current_item( $request ) X-Ref |
| Deletes the current user. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 4.7.0 param: WP_REST_Request $request Full details about the request. |
| prepare_item_for_response( $item, $request ) X-Ref |
| Prepares a single user output for response. return: WP_REST_Response Response object. since: 4.7.0 since: 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. param: WP_User $item User object. param: WP_REST_Request $request Request object. |
| prepare_links( $user ) X-Ref |
| Prepares links for the user request. return: array Links for the given user. since: 4.7.0 param: WP_User $user User object. |
| prepare_item_for_database( $request ) X-Ref |
| Prepares a single user for creation or update. return: object User object. since: 4.7.0 param: WP_REST_Request $request Request object. |
| check_role_update( $user_id, $roles ) X-Ref |
| Determines if the current user is allowed to make the desired roles change. return: true|WP_Error True if the current user is allowed to make the role change, since: 4.7.0 param: int $user_id User ID. param: array $roles New user roles. |
| check_username( $value, $request, $param ) X-Ref |
| Check a username for the REST API. Performs a couple of checks like edit_user() in wp-admin/includes/user.php. return: string|WP_Error The sanitized username, if valid, otherwise an error. since: 4.7.0 param: string $value The username submitted in the request. param: WP_REST_Request $request Full details about the request. param: string $param The parameter name. |
| check_user_password( $value, $request, $param ) X-Ref |
| Check a user password for the REST API. Performs a couple of checks like edit_user() in wp-admin/includes/user.php. return: string|WP_Error The sanitized password, if valid, otherwise an error. since: 4.7.0 param: string $value The password submitted in the request. param: WP_REST_Request $request Full details about the request. param: string $param The parameter name. |
| get_item_schema() X-Ref |
| Retrieves the user's schema, conforming to JSON Schema. return: array Item schema data. since: 4.7.0 |
| get_collection_params() X-Ref |
| Retrieves the query params for collections. return: array Collection parameters. since: 4.7.0 |
| Generated: Mon Oct 27 01:00:02 2025 | Cross-referenced by PHPXref 0.7.1 |