Api implements Registerable, Standard_Service
REST Api handler.
Tags
Interfaces, Classes and Traits
- Registerable
- Standard_Service
Table of Contents
- API_NAMESPACE = 'wcf/v1'
- check_permissions() : WP_Error|bool
- Check if a given request has admin access.
- check_public_permission() : bool
- Verify frontend requests.
- get_indexer_status() : WP_REST_Response
- Get the status of the indexer.
- get_terms() : WP_REST_Response
- Retrieve the list of terms for a given taxonomy.
- register() : void
- Hook into WP.
- register_routes() : void
- Register the REST Api routes.
- start_batch_index() : WP_REST_Response
- Start the batch indexing of all products.
Constants
API_NAMESPACE
public
mixed
API_NAMESPACE
= 'wcf/v1'
Methods
check_permissions()
Check if a given request has admin access.
public
check_permissions(WP_REST_Request $request) : WP_Error|bool
Parameters
- $request : WP_REST_Request
-
Full data about the request.
Return values
WP_Error|bool —check_public_permission()
Verify frontend requests.
public
check_public_permission(WP_REST_Request $request) : bool
Parameters
- $request : WP_REST_Request
-
Full data about the request.
Return values
bool —get_indexer_status()
Get the status of the indexer.
public
get_indexer_status(WP_REST_Request $request) : WP_REST_Response
Parameters
- $request : WP_REST_Request
Return values
WP_REST_Response —get_terms()
Retrieve the list of terms for a given taxonomy.
public
get_terms(WP_REST_Request $request) : WP_REST_Response
Parameters
- $request : WP_REST_Request
Return values
WP_REST_Response —register()
Hook into WP.
public
register() : void
Return values
void —register_routes()
Register the REST Api routes.
public
register_routes() : void
Return values
void —start_batch_index()
Start the batch indexing of all products.
public
start_batch_index(WP_REST_Request $request) : WP_REST_Response
Parameters
- $request : WP_REST_Request