rest_url WordPress Filter Hook
The rest_url hook is used to modify the URL of the REST API. This can be useful for adding extra data to the request, or for changing the endpoint entirely.
apply_filters( 'rest_url', string $url , string $path , int|null $blog_id , string $scheme ) #
Filters the REST URL.
Description
Use this filter to adjust the url returned by the get_rest_url() function.
Parameters
- $url
(string)REST URL.
- $path
(string)REST route.
- $blog_id
(int|null)Blog ID.
- $scheme
(string)Sanitization scheme.
Source
File: wp-includes/rest-api.php
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |