REST API: Fix links format in OPTIONS requests for non-variable routes.

Props nsundberg, johnwatkins0, birgire.
Fixes #49149.

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


git-svn-id: http://core.svn.wordpress.org/trunk@47120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
TimothyBlynJacobs 2020-02-20 00:55:05 +00:00
parent 808768224d
commit 450d49183b
2 changed files with 6 additions and 2 deletions

View File

@ -1288,7 +1288,11 @@ class WP_REST_Server {
// For non-variable routes, generate links.
if ( strpos( $route, '{' ) === false ) {
$data['_links'] = array(
'self' => rest_url( $route ),
'self' => array(
array(
'href' => rest_url( $route ),
),
),
);
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-beta2-47325';
$wp_version = '5.4-beta2-47326';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.