WP_REST_Users_Controller::prepare_links( WP_User $user ): array
Prepares links for the user request.
Parameters
-
$user
WP_User Required -
User object.
Return
array Links for the given user.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
.
View all references
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;
}
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |