- Timestamp:
- 09/11/2022 06:53:28 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r53760 r54121 304 304 $response->header( 'X-WP-TotalPages', (int) $max_pages ); 305 305 306 $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( $this->namespace . '/' . $this->rest_base ) ); 306 $request_params = $request->get_query_params(); 307 $collection_url = rest_url( rest_get_route_for_taxonomy_items( $this->taxonomy ) ); 308 $base = add_query_arg( urlencode_deep( $request_params ), $collection_url ); 309 307 310 if ( $page > 1 ) { 308 311 $prev_page = $page - 1; … … 894 897 */ 895 898 protected function prepare_links( $term ) { 896 $base = $this->namespace . '/' . $this->rest_base;897 899 $links = array( 898 900 'self' => array( 899 'href' => rest_url( trailingslashit( $base ) . $term->term_id),901 'href' => rest_url( rest_get_route_for_term( $term ) ), 900 902 ), 901 903 'collection' => array( 902 'href' => rest_url( $base),904 'href' => rest_url( rest_get_route_for_taxonomy_items( $this->taxonomy ) ), 903 905 ), 904 906 'about' => array( … … 912 914 if ( $parent_term ) { 913 915 $links['up'] = array( 914 'href' => rest_url( trailingslashit( $base ) . $parent_term->term_id),916 'href' => rest_url( rest_get_route_for_term( $parent_term ) ), 915 917 'embeddable' => true, 916 918 );
Note: See TracChangeset
for help on using the changeset viewer.