rest_url

The timeline below displays how wordpress function rest_url has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.3

/**
 * Retrieves the URL to a REST endpoint.
 *
 * Note: The returned URL is NOT escaped.
 *
 * @since 4.4.0
 *
 * @param string $path   Optional. REST route. Default empty.
 * @param string $scheme Optional. Sanitization scheme. Default 'rest'.
 * @return string Full URL to the endpoint.
 */
function rest_url($path = '', $scheme = 'rest')
{
    return get_rest_url(null, $path, $scheme);
}

WordPress Version: 4.4

/**
 * Retrieves the URL to a REST endpoint.
 *
 * Note: The returned URL is NOT escaped.
 *
 * @since 4.4.0
 *
 * @param string $path   Optional. REST route. Default empty.
 * @param string $scheme Optional. Sanitization scheme. Default 'json'.
 * @return string Full URL to the endpoint.
 */
function rest_url($path = '', $scheme = 'json')
{
    return get_rest_url(null, $path, $scheme);
}