WP_REST_Taxonomies_Controller::prepare_links( WP_Taxonomy $taxonomy ): array
Prepares links for the request.
Parameters
-
$taxonomy
WP_Taxonomy Required -
The taxonomy.
Return
array Links for the given taxonomy.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
.
View all references
protected function prepare_links( $taxonomy ) {
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_taxonomy_items( $taxonomy->name ) ),
),
);
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |