rest_url( string $path = '', string $scheme = 'json' )
Retrieves the URL to a REST endpoint.
Description
Note: The returned URL is NOT escaped.
Parameters
- $path
-
(Optional) REST route.
Default value: ''
- $scheme
-
(Optional) Sanitization scheme. Default 'json'.
Default value: 'json'
Return
(string) Full URL to the endpoint.
Source
File: wp-includes/rest-api.php
function rest_url( $path = '', $scheme = 'json' ) {
return get_rest_url( null, $path, $scheme );
}
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |