REST API: Ensure that the parent link, uses the rest_get_route_for_post function.

In [51962] the `rest_get_route_for_post` function was implemented in all places where link to a post's REST API endpoint is needed. However in this commit, the up link, which links to the parent post of the current object, did not use this function.   

Props Spacedmonkey, SergeyBiryukov.
Fixes #53656.



Built from https://develop.svn.wordpress.org/trunk@52363


git-svn-id: http://core.svn.wordpress.org/trunk@51955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
spacedmonkey 2021-12-13 15:20:03 +00:00
parent d09d194f12
commit 120b1ab117
2 changed files with 2 additions and 2 deletions

View File

@ -2039,7 +2039,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {
$links['up'] = array(
'href' => rest_url( trailingslashit( $base ) . (int) $post->post_parent ),
'href' => rest_url( rest_get_route_for_post( $post->post_parent ) ),
'embeddable' => true,
);
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta2-52362';
$wp_version = '5.9-beta2-52363';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.