Changeset 53722 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
- Timestamp:
- 07/19/2022 02:52:12 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php
r51965 r53722 273 273 $response = rest_ensure_response( $data ); 274 274 275 $response->add_links( 276 array( 277 'collection' => array( 278 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), 279 ), 280 'https://api.w.org/items' => array( 281 'href' => rest_url( rest_get_route_for_taxonomy_items( $taxonomy->name ) ), 282 ), 283 ) 284 ); 275 $response->add_links( $this->prepare_links( $taxonomy ) ); 285 276 286 277 /** … … 438 429 } 439 430 431 /** 432 * Prepares links for the request. 433 * 434 * @since 6.1.0 435 * 436 * @param @param WP_Taxonomy $taxonomy The taxonomy. 437 * @return array Links for the given taxonomy. 438 */ 439 protected function prepare_links( $taxonomy ) { 440 return array( 441 'collection' => array( 442 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), 443 ), 444 'https://api.w.org/items' => array( 445 'href' => rest_url( rest_get_route_for_taxonomy_items( $taxonomy->name ) ), 446 ), 447 ); 448 } 449 440 450 }
Note: See TracChangeset
for help on using the changeset viewer.