WooCommerce Code Reference

Server
in package
Uses SingletonTrait

Class responsible for loading the REST API and all REST API namespaces.

Table of Contents

$controllers  : array<string|int, mixed>
REST API namespaces and endpoints.
$instance  : object
The single instance of the class.
__wakeup()  : mixed
Prevent unserializing.
get_path()  : string
Return the path to the package.
init()  : mixed
Hook into WordPress ready to init the REST API as needed.
instance()  : object
Get class instance.
register_rest_routes()  : mixed
Register REST API routes.
__construct()  : void
Constructor
get_rest_namespaces()  : array<string|int, mixed>
Get API namespaces - new namespaces should be registered here.
get_telemetry_controllers()  : array<string|int, mixed>
List of controllers in the telemetry namespace.
get_v1_controllers()  : array<string|int, mixed>
List of controllers in the wc/v1 namespace.
get_v2_controllers()  : array<string|int, mixed>
List of controllers in the wc/v2 namespace.
get_v3_controllers()  : array<string|int, mixed>
List of controllers in the wc/v3 namespace.
__clone()  : mixed
Prevent cloning.

Properties

$controllers

REST API namespaces and endpoints.

protected array<string|int, mixed> $controllers = array()

Methods

init()

Hook into WordPress ready to init the REST API as needed.

public init() : mixed
Return values
mixed

register_rest_routes()

Register REST API routes.

public register_rest_routes() : mixed
Return values
mixed

get_rest_namespaces()

Get API namespaces - new namespaces should be registered here.

protected get_rest_namespaces() : array<string|int, mixed>
Return values
array<string|int, mixed>List of Namespaces and Main controller classes.

get_telemetry_controllers()

List of controllers in the telemetry namespace.

protected get_telemetry_controllers() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_v1_controllers()

List of controllers in the wc/v1 namespace.

protected get_v1_controllers() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_v2_controllers()

List of controllers in the wc/v2 namespace.

protected get_v2_controllers() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_v3_controllers()

List of controllers in the wc/v3 namespace.

protected get_v3_controllers() : array<string|int, mixed>
Return values
array<string|int, mixed>