Summery Summery
Prepares links for the user request.
Syntax Syntax
Parameters Parameters
- $user
-
(Required) User object.
Return Return
(array) Links for the given user.
Source Source
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; }
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |