Changeset 53724 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
- Timestamp:
- 07/19/2022 04:20:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php
r53721 r53724 262 262 263 263 /** 264 * Prepares links for the request. 265 * 266 * @since 6.1.0 267 * 268 * @param WP_Post_Type $post_type The post type. 269 * @return array Links for the given post type. 270 */ 271 protected function prepare_links( $post_type ) { 272 return array( 273 'collection' => array( 274 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), 275 ), 276 'https://api.w.org/items' => array( 277 'href' => rest_url( rest_get_route_for_post_type_items( $post_type->name ) ), 278 ), 279 ); 280 } 281 282 /** 264 283 * Retrieves the post type's schema, conforming to JSON Schema. 265 284 * … … 385 404 ); 386 405 } 387 388 /**389 * Prepares links for the request.390 *391 * @since 6.1.0392 *393 * @param WP_Post_Type $post_type The post type.394 * @return array Links for the given post type.395 */396 protected function prepare_links( $post_type ) {397 return array(398 'collection' => array(399 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),400 ),401 'https://api.w.org/items' => array(402 'href' => rest_url( rest_get_route_for_post_type_items( $post_type->name ) ),403 ),404 );405 }406 406 }
Note: See TracChangeset
for help on using the changeset viewer.