Function: rest_handle_options_request

rest_handle_options_request( mixed $response, WP_REST_Server $handler, WP_REST_Request $request )

Handles OPTIONS requests for the server.

Shortcut: rhor

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

This is handled outside of the server code, as it doesn't obey normal route mapping.

Parameters

Name Type(s) Default Value Description
$response mixed

Current response, either response or null to indicate pass-through.

$handler WP_REST_Server

ResponseHandler instance (usually WP_REST_Server).

$request WP_REST_Request

The request that was used to make current response.

Returns

WP_REST_Response

Modified response, either response or null to indicate pass-through.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.