RestApi
RestApi class.
Description Description
Registers controllers in the blocks REST API namespace.
Source Source
File: packages/woocommerce-blocks/src/RestApi.php
Methods Methods
- __construct — Constructor
- get_controllers — Return a list of controller classes for this REST API namespace.
- get_routes_from_namespace — Get routes for a namespace.
- init — Initialize class features.
- is_request_to_store_api — Check if is request to the Store API.
- maybe_init_cart_session — If we're making a cart request, we may need to load some additonal classes from WC Core so we're ready to deal with requests.
- register_rest_routes — Register REST API routes.
- store_api_authentication — The Store API does not require authentication.
- store_api_logged_in_cookie — When the login cookies are set, they are not available until the next page reload. For the Store API, specifically for returning updated nonces, we need this to be available immediately.