WC_Helper_Subscriptions_API
in package
WC_Helper_Subscriptions_API
The main entry-point for all things related to the Marketplace Subscriptions API. The Subscriptions API manages WooCommerce.com Subscriptions.
Table of Contents
- activate() : mixed
- Activate a WooCommerce.com product.
- connect() : mixed
- Connect a WooCommerce.com subscription.
- disconnect() : mixed
- Disconnect a WooCommerce.com subscription.
- get_permission() : mixed
- The Extensions page can only be accessed by users with the manage_woocommerce capability. So the API mimics that behavior.
- get_subscriptions() : mixed
- Fetch subscriptions from WooCommerce.com and serve them as JSON.
- install_url() : mixed
- Get the install URL for a WooCommerce.com product.
- load() : void
- Loads the class, runs on init
- refresh() : mixed
- Refresh account and subscriptions from WooCommerce.com and serve subscriptions as JSON.
- register_rest_routes() : mixed
- Registers the REST routes for the Marketplace Subscriptions API.
Methods
activate()
Activate a WooCommerce.com product.
public
static activate(WP_REST_Request $request) : mixed
This activates the plugin/theme on the site.
Parameters
- $request : WP_REST_Request
-
Request object.
Return values
mixed —connect()
Connect a WooCommerce.com subscription.
public
static connect(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
-
Request object.
Return values
mixed —disconnect()
Disconnect a WooCommerce.com subscription.
public
static disconnect(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
-
Request object.
Return values
mixed —get_permission()
The Extensions page can only be accessed by users with the manage_woocommerce capability. So the API mimics that behavior.
public
static get_permission() : mixed
Return values
mixed —get_subscriptions()
Fetch subscriptions from WooCommerce.com and serve them as JSON.
public
static get_subscriptions() : mixed
Return values
mixed —install_url()
Get the install URL for a WooCommerce.com product.
public
static install_url(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
-
Request object.
Return values
mixed —load()
Loads the class, runs on init
public
static load() : void
Return values
void —refresh()
Refresh account and subscriptions from WooCommerce.com and serve subscriptions as JSON.
public
static refresh() : mixed
Return values
mixed —register_rest_routes()
Registers the REST routes for the Marketplace Subscriptions API.
public
static register_rest_routes() : mixed
These endpoints are used by the Marketplace Subscriptions React UI.