WC_REST_WCCOM_Site_Installer_Controller_V2::install()
Install WooCommerce.com products.
Method of the class: WC_REST_WCCOM_Site_Installer_Controller_V2{}
No Hooks.
Return
WP_REST_Response|WP_Error
.
Usage
$WC_REST_WCCOM_Site_Installer_Controller_V2 = new WC_REST_WCCOM_Site_Installer_Controller_V2(); $WC_REST_WCCOM_Site_Installer_Controller_V2->install( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
Changelog
Since 7.7.0 | Introduced. |
WC_REST_WCCOM_Site_Installer_Controller_V2::install() WC REST WCCOM Site Installer Controller V2::install code WC 7.7.0
public function install( $request ) { try { $product_id = $request['product-id']; $run_until_step = $request['run-until-step']; $idempotency_key = $request['idempotency-key']; $installation_manager = new WC_WCCOM_Site_Installation_Manager( $product_id, $idempotency_key ); $installation_manager->run_installation( $run_until_step ); $response = $this->success_response( $product_id ); } catch ( Installer_Error $exception ) { $response = $this->failure_response( $product_id, $exception ); } return $response; }