WC_REST_WCCOM_Site_Installer_Controller::reset_install()publicWC 7.7.0

Reset installation state.

Method of the class: WC_REST_WCCOM_Site_Installer_Controller{}

No Hooks.

Return

WP_REST_Response|WP_Error.

Usage

$WC_REST_WCCOM_Site_Installer_Controller = new WC_REST_WCCOM_Site_Installer_Controller();
$WC_REST_WCCOM_Site_Installer_Controller->reset_install( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Changelog

Since 7.7.0 Introduced.

WC_REST_WCCOM_Site_Installer_Controller::reset_install() code WC 9.4.2

public function reset_install( $request ) {
	try {
		$product_id      = $request['product-id'];
		$idempotency_key = $request['idempotency-key'];

		$installation_manager = new WC_WCCOM_Site_Installation_Manager( $product_id, $idempotency_key );
		$installation_manager->reset_installation();

		$response = $this->success_response( $product_id );

	} catch ( Installer_Error $exception ) {
		$response = $this->failure_response( $product_id, $exception );
	}

	return $response;
}