Rest_Controller
extends Base_Server
in package
implements
Service, Registerable, Rest_Server
Registers the quick view REST routes.
Tags
Interfaces, Classes and Traits
- Service
- Marker interface to denote a service.
- Registerable
- An object that can be registered with WordPress via the Plugin API, i.e. add_action() and add_filter().
- Rest_Server
- A REST server is the main entry point for a REST system. Registers the routes etc.
Table of Contents
- REST_NAMESPACE = 'wc-quick-view-pro/v1'
- $routes : array<string|int, Route>
- __construct() : mixed
- get_endpoints() : array<string|int, string>
- Get the list of route endpoints.
- get_namespace() : string
- Get the namespace for the REST routes that this server registers.
- get_routes() : array<string|int, Route>
- Get the list of routes managed by this REST server.
- nonce_user_logged_out() : int
- Prevent WooCommerce overriding the user ID for logged out users as this breaks our nonce validation.
- register() : mixed
- register_routes() : mixed
Constants
REST_NAMESPACE
public
mixed
REST_NAMESPACE
= 'wc-quick-view-pro/v1'
Properties
$routes
private
array<string|int, Route>
$routes
= []
The list of REST route objects handled by this server.
Methods
__construct()
public
__construct() : mixed
Return values
mixed —get_endpoints()
Get the list of route endpoints.
public
get_endpoints() : array<string|int, string>
Return values
array<string|int, string> —The list of endpoints.
get_namespace()
Get the namespace for the REST routes that this server registers.
public
get_namespace() : string
Return values
string —The namespace.
get_routes()
Get the list of routes managed by this REST server.
public
get_routes() : array<string|int, Route>
Return values
array<string|int, Route> —The list of routes.
nonce_user_logged_out()
Prevent WooCommerce overriding the user ID for logged out users as this breaks our nonce validation.
public
nonce_user_logged_out(int $uid, string $action) : int
Parameters
- $uid : int
-
The user ID
- $action : string
-
The nonce action
Return values
int —The user ID when logged out
register()
public
register() : mixed
Return values
mixed —register_routes()
public
register_routes() : mixed