WP_REST_Templates_Controller::prepare_links( integer $id ): array
Prepares links for the request.
Parameters
-
$id
integer Required -
ID.
Return
array Links for the given post.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
.
View all references
protected function prepare_links( $id ) {
$links = array(
'self' => array(
'href' => rest_url( rest_get_route_for_post( $id ) ),
),
'collection' => array(
'href' => rest_url( rest_get_route_for_post_type_items( $this->post_type ) ),
),
'about' => array(
'href' => rest_url( 'wp/v2/types/' . $this->post_type ),
),
);
return $links;
}
Changelog
Version | Description |
---|---|
5.8.0 | Introduced. |