Uses
| Uses | Description |
|---|---|
| wp-includes/rest-api.php: rest_url() | Retrieves the URL to a REST endpoint. |
Prepares links for the user request.
(WP_Post) (Required) User object.
(array) Links for the given user.
File: wp-includes/rest-api/endpoints/class-wp-rest-users-controller.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;
} | Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_users_controller/prepare_links