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

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
return: int|bool|WP_Error

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has read access, otherwise WP_Error object.

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

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

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has read access for the item, otherwise WP_Error object.

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

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

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has access to create items, WP_Error object otherwise.

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has access to update the item, WP_Error object otherwise.

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has access to update the item, WP_Error object otherwise.

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.

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

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

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

param: WP_REST_Request $request Full details about the request.
since: 4.7.0
return: true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.

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

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

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

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.
return: WP_REST_Response Response object.

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

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

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

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

check_role_update( $user_id, $roles )   X-Ref
Determines if the current user is allowed to make the desired roles change.

param: int   $user_id User ID.
param: array $roles   New user roles.
since: 4.7.0
return: true|WP_Error True if the current user is allowed to make the role change,

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.

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
return: string|WP_Error The sanitized username, if valid, otherwise an error.

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.

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
return: string|WP_Error The sanitized password, if valid, otherwise an error.

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