WordPress at a glance
function is not described

WP_REST_Users_Controller::prepare_links() protected WP 4.7.0

Prepares links for the user request.

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

No Hooks.

Return

Array. Links for the given user.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_links( $user );
$user(WP_Post) (required)
User object.

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Users_Controller::prepare_links() WP 5.5.1

<?php
protected function prepare_links( $user ) {
	$links = array(
		'self'       => array(
			'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ),
		),
		'collection' => array(
			'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
		),
	);

	return $links;
}