Prepares links for the request.
Parameters
$post_type
WP_Post_Typerequired- The post type.
Source
protected function prepare_links( $post_type ) {
return array(
'collection' => array(
'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
),
'https://api.w.org/items' => array(
'href' => rest_url( rest_get_route_for_post_type_items( $post_type->name ) ),
),
);
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.