mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
d09d194f12
commit
120b1ab117
@ -2039,7 +2039,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
|||||||
|
|
||||||
if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {
|
if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) {
|
||||||
$links['up'] = array(
|
$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,
|
'embeddable' => true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user