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 Description

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

Parameters Parameters


(bool) Whether the request has already been served. Default false.


(WP_HTTP_Response) Result to send to the client. Usually a WP_REST_Response.


(WP_REST_Request) Request used to generate the response.


(WP_REST_Server) Server instance.

Top ↑

Source Source

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

View on Trac

Top ↑

Changelog Changelog

Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.