WooCommerce Code Reference

WC_REST_V4_Controller extends WP_REST_Controller
in package

WooCommerce REST API Version 4 Base Controller

Tags
extends

WP_REST_Controller

version
4.0.0

Table of Contents

$namespace  : string
Endpoint namespace.
$rest_base  : string
Route base.
prepare_response_for_collection()  : array<string|int, mixed>
Prepare a response for inserting into a collection.
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

Methods

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.

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