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.


Top ↑

Parameters

$url

(string)REST URL.

$path

(string)REST route.

$blog_id

(int|null)Blog ID.

$scheme

(string)Sanitization scheme.


Top ↑

Source

File: wp-includes/rest-api.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More