WC_REST_WCCOM_Site_Installer_Controller::install()
Install WooCommerce.com products.
Метод класса: WC_REST_WCCOM_Site_Installer_Controller{}
Хуков нет.
Возвращает
WP_REST_Response|WP_Error
.
Использование
$WC_REST_WCCOM_Site_Installer_Controller = new WC_REST_WCCOM_Site_Installer_Controller(); $WC_REST_WCCOM_Site_Installer_Controller->install( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Список изменений
С версии 7.7.0 | Введена. |
Код WC_REST_WCCOM_Site_Installer_Controller::install() WC REST WCCOM Site Installer Controller::install WC 9.8.1
woocommerce/includes/wccom-site/rest-api/endpoints/class-wc-rest-wccom-site-installer-controller.php
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; }