[ 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 ''.

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

get_items_permissions_check( $request )   X-Ref
Permissions check for getting all users.

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

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

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

get_user( $id )   X-Ref
Get the user, if the ID is valid.

since: 4.7.2
return: WP_User|WP_Error True if ID is valid, WP_Error otherwise.
param: int $id Supplied ID.

get_item_permissions_check( $request )   X-Ref
Checks if a given request has access to read a user.

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

get_item( $request )   X-Ref
Retrieves a single user.

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

get_current_item( $request )   X-Ref
Retrieves the current user.

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

create_item_permissions_check( $request )   X-Ref
Checks if a given request has access create users.

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

create_item( $request )   X-Ref
Creates a single user.

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

update_item_permissions_check( $request )   X-Ref
Checks if a given request has access to update a user.

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

update_item( $request )   X-Ref
Updates a single user.

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

update_current_item_permissions_check( $request )   X-Ref
Checks if a given request has access to update the current user.

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

update_current_item( $request )   X-Ref
Updates the current user.

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

delete_item_permissions_check( $request )   X-Ref
Checks if a given request has access delete a user.

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

delete_item( $request )   X-Ref
Deletes a single user.

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

delete_current_item_permissions_check( $request )   X-Ref
Checks if a given request has access to delete the current user.

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

delete_current_item( $request )   X-Ref
Deletes the current user.

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

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

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

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

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

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

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

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

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.

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

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.

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

get_item_schema()   X-Ref
Retrieves the user's schema, conforming to JSON Schema.

since: 4.7.0
return: array Item schema data.

get_collection_params()   X-Ref
Retrieves the query params for collections.

since: 4.7.0
return: array Collection parameters.



Generated: Fri Apr 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1