Automattic\WooCommerce\Admin\API
MarketingOverview::register_routes
Register routes.
Method of the class: MarketingOverview{}
No Hooks.
Returns
null. Nothing (null).
Usage
$MarketingOverview = new MarketingOverview(); $MarketingOverview->register_routes();
MarketingOverview::register_routes() MarketingOverview::register routes code WC 10.3.3
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/activate-plugin',
array(
array(
'methods' => \WP_REST_Server::EDITABLE,
'callback' => array( $this, 'activate_plugin' ),
'permission_callback' => array( $this, 'install_plugins_permissions_check' ),
'args' => array(
'plugin' => array(
'required' => true,
'type' => 'string',
'validate_callback' => 'rest_validate_request_arg',
'sanitize_callback' => 'sanitize_title_with_dashes',
),
),
),
'schema' => array( $this, 'get_item_schema' ),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/installed-plugins',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array( $this, 'get_installed_plugins' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}