rest_request_from_url WordPress Filter Hook

The rest_request_from_url hook allows you to modify the request before it is sent to the REST API. This can be useful for adding query parameters or changing the request method.

apply_filters( 'rest_request_from_url', WP_REST_Request|false $request, string $url ) #

Filters the REST API request generated from a URL.


Parameters

$request

(WP_REST_Request|false)Generated request object, or false if URL could not be parsed.

$url

(string)URL the request was generated from.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-request.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.5.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.