WordPress.org

Make WordPress Core

Changeset 46233


Ignore:
Timestamp:
09/22/2019 07:14:03 PM (2 months ago)
Author:
kadamwhite
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r46184 r46233  
    412412 *
    413413 * @param string $path   Optional. REST route. Default empty.
    414  * @param string $scheme Optional. Sanitization scheme. Default 'json'.
     414 * @param string $scheme Optional. Sanitization scheme. Default 'rest'.
    415415 * @return string Full URL to the endpoint.
    416416 */
    417 function rest_url( $path = '', $scheme = 'json' ) {
     417function rest_url( $path = '', $scheme = 'rest' ) {
    418418    return get_rest_url( null, $path, $scheme );
    419419}
Note: See TracChangeset for help on using the changeset viewer.