Skip to content
Permalink
Browse files

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
  • Loading branch information...
kadamwhite committed Sep 22, 2019
1 parent 6bd7097 commit 308e86cd78f5850095aae007f2d990c8729cad55
Showing with 2 additions and 2 deletions.
  1. +2 −2 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 );
}

0 comments on commit 308e86c

Please sign in to comment.
You can’t perform that action at this time.