WordPress at a glance
function is not described

WP_REST_Users_Controller::get_item() public WP 4.7.0

Retrieves a single user.

It's a method of the class: WP_REST_Users_Controller{}

No Hooks.


WP_REST_Response/WP_Error. Response object on success, or WP_Error object on failure.


$WP_REST_Users_Controller = new WP_REST_Users_Controller();
$WP_REST_Users_Controller->get_item( $request );
$request(WP_REST_Request) (required)
Full details about the request.


Since 4.7.0 Introduced.

Code of WP_REST_Users_Controller::get_item() WP 5.5.1

public function get_item( $request ) {
	$user = $this->get_user( $request['id'] );
	if ( is_wp_error( $user ) ) {
		return $user;

	$user     = $this->prepare_item_for_response( $user, $request );
	$response = rest_ensure_response( $user );

	return $response;