apply_filters( 'rest_pre_serve_request', bool $served, WP_HTTP_Response $result, WP_REST_Request $request, WP_REST_Server $this )

Filters whether the request has already been served.


Description

Allow sending the request manually – by returning true, the API result will not be sent to the client.


Parameters

$served

Whether the request has already been served. Default false.

$result

Result to send to the client. Usually a WP_REST_Response.

$request

Request used to generate the response.

$this

Server instance.


Source

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

View on GitHub



Changelog

Changelog
Version Description
WP-4.4.0 Introduced.