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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@46045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
K. Adam White 2019-09-22 19:15:57 +00:00
parent e36d1bcbd8
commit 6da9c88729
2 changed files with 3 additions and 3 deletions

View File

@ -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 );
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46232';
$wp_version = '5.3-alpha-46233';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.