Preflight implements Registerable, Standard_Service Uses Api_Can_Send_Error

Preflight service.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

preflight()  : WP_REST_Response
Preflight the API.
register()  : void
Register the service.
register_routes()  : void
Register the REST Api routes.
send_error()  : WP_REST_Response
Send an error response.

Methods

preflight()

Preflight the API.

public preflight(WP_REST_Request $request) : WP_REST_Response

This endpoint is used to return the list of initial filters that are meant to be displayed on the frontend.

Parameters
$request : WP_REST_Request
Return values
WP_REST_Response

register()

Register the service.

public register() : void
Return values
void

register_routes()

Register the REST Api routes.

public register_routes() : void
Return values
void

send_error()

Send an error response.

protected send_error(string $message[, int $code = 400 ]) : WP_REST_Response
Parameters
$message : string

The error message.

$code : int = 400

The error code.

Return values
WP_REST_Response

Search results