Core Function
View Source on Trac ↗ get_rest_url()
get_rest_url( mixed $blog_id = null, mixed $path = '/', mixed $scheme = 'rest' ) Retrieves the URL to a REST endpoint on a site.
Parameters 1 required
| Name / Type | Description |
|---|---|
| (int | | null) $blog_id Optional. Blog ID. Default of null returns URL for current blog. Required |
| $path string | Optional. REST route. Default '/'. |
| $scheme string | Optional. Sanitization scheme. Default 'rest'. |
Return Value
(string)
Full URL to the endpoint.
Function Information
Since Version
4.4.0
Source File
wp-includes/rest-api.php
Advertisement