[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/rest-api/endpoints/ -> class-wp-rest-users-controller.php (summary)

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

Defines 1 class

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
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.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

get_items( $request )   X-Ref
Retrieves all users.

return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: int $id Supplied ID.
since: 4.7.2

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

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.
param: WP_REST_Request $request Full details about the request.
since: 4.7.0

prepare_item_for_response( $item, $request )   X-Ref
Prepares a single user output for response.

return: WP_REST_Response Response object.
param: WP_User         $item    User object.
param: WP_REST_Request $request Request object.
since: 4.7.0
since: 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support.

prepare_links( $user )   X-Ref
Prepares links for the user request.

return: array Links for the given user.
param: WP_User $user User object.
since: 4.7.0

prepare_item_for_database( $request )   X-Ref
Prepares a single user for creation or update.

return: object User object.
param: WP_REST_Request $request Request object.
since: 4.7.0

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,
param: int   $user_id User ID.
param: array $roles   New user roles.
since: 4.7.0

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.
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.
since: 4.7.0

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.
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.
since: 4.7.0

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: Sat Nov 23 01:00:02 2024 Cross-referenced by PHPXref 0.7.1