From 450d49183bf43af4c860b81d735acfb2e92fd418 Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Thu, 20 Feb 2020 00:55:05 +0000 Subject: [PATCH] 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 --- wp-includes/rest-api/class-wp-rest-server.php | 6 +++++- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index efda2321b7..12de6c55f0 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -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 ), + ), + ), ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 33e53faa4a..73fbcf2aca 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.