rest_url filter-hook . WP 4.4.0
Filters the REST URL.
Use this filter to adjust the url returned by the get_rest_url() function.
Usage
add_filter( 'rest_url', 'filter_function_name_5371', 10, 4 ); function filter_function_name_5371( $url, $path, $blog_id, $scheme ){ // filter... return $url; }
- $url(string)
- REST URL.
- $path(string)
- REST route.
- $blog_id(int)
- Blog ID.
- $scheme(string)
- Sanitization scheme.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
rest_url
wp-includes/rest-api.php 449
return apply_filters( 'rest_url', $url, $path, $blog_id, $scheme );