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:
@@ -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 ),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user