diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 4aa893e907..dfb97f7b60 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -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, ); }