From 308e86cd78f5850095aae007f2d990c8729cad55 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Sun, 22 Sep 2019 19:14:03 +0000 Subject: [PATCH] REST API: Consistently default URL scheme to "rest", not "json". The "json" scheme is a holdover from the pre-merge plugin version of the REST API, and was corrected elsewhere in core in [34300]. Only "rest" is officially supported in `set_url_scheme()`. Props DrewAPicture, rmccue. Fixes #45169. git-svn-id: https://develop.svn.wordpress.org/trunk@46233 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/rest-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 68f13c2ac1..8c809c89ba 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -411,10 +411,10 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { * @since 4.4.0 * * @param string $path Optional. REST route. Default empty. - * @param string $scheme Optional. Sanitization scheme. Default 'json'. + * @param string $scheme Optional. Sanitization scheme. Default 'rest'. * @return string Full URL to the endpoint. */ -function rest_url( $path = '', $scheme = 'json' ) { +function rest_url( $path = '', $scheme = 'rest' ) { return get_rest_url( null, $path, $scheme ); }