WC_REST_Ping_V4_Controller
extends WC_REST_V4_Controller
in package
REST API Ping controller class.
Tags
Table of Contents
- $namespace : string
- Endpoint namespace.
- $rest_base : string
- Route base.
- get_item_schema() : array<string|int, mixed>
- Get the ping schema, conforming to JSON Schema.
- get_ping() : WP_Error|WP_REST_Response
- Get ping response.
- get_ping_permissions_check() : WP_Error|bool
- Check whether a given request has permission to read ping.
- prepare_response_for_collection() : array<string|int, mixed>
- Prepare a response for inserting into a collection.
- register_routes() : mixed
- Register the routes for ping.
- check_permissions() : bool|WP_Error
- Check permissions for a given request.
- get_api_version() : string
- Get the default REST API version.
- get_base_schema() : array<string|int, mixed>
- Get the base schema for the API.
Properties
$namespace
Endpoint namespace.
protected
string
$namespace
= 'wc/v4'
$rest_base
Route base.
protected
string
$rest_base
= 'ping'
Methods
get_item_schema()
Get the ping schema, conforming to JSON Schema.
public
get_item_schema() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_ping()
Get ping response.
public
get_ping(WP_REST_Request $request) : WP_Error|WP_REST_Response
Parameters
- $request : WP_REST_Request
-
Request data.
Tags
Return values
WP_Error|WP_REST_Response —get_ping_permissions_check()
Check whether a given request has permission to read ping.
public
get_ping_permissions_check(WP_REST_Request $request) : WP_Error|bool
Parameters
- $request : WP_REST_Request
-
Full details about the request.
Return values
WP_Error|bool —prepare_response_for_collection()
Prepare a response for inserting into a collection.
public
prepare_response_for_collection(WP_REST_Response $response) : array<string|int, mixed>
Parameters
- $response : WP_REST_Response
-
Response object.
Return values
array<string|int, mixed> — Response data.register_routes()
Register the routes for ping.
public
register_routes() : mixed
Tags
Return values
mixed —check_permissions()
Check permissions for a given request.
protected
check_permissions(WP_REST_Request $request[, string $permission = 'read' ]) : bool|WP_Error
Parameters
- $request : WP_REST_Request
-
Full details about the request.
- $permission : string = 'read'
-
The permission to check for.
Return values
bool|WP_Error —get_api_version()
Get the default REST API version.
protected
get_api_version() : string
Return values
string —get_base_schema()
Get the base schema for the API.
protected
get_base_schema() : array<string|int, mixed>
