WC_REST_WCCOM_Site_Installer_Controller::install( WP_REST_Request $request )
Install WooCommerce.com products.
Description Description
Parameters Parameters
- $request
-
(Required) Full details about the request.
Return Return
(bool|WP_Error)
Source Source
File: includes/wccom-site/rest-api/endpoints/class-wc-rest-wccom-site-installer-controller.php
public function install( $request ) { $requirements_met = WC_WCCOM_Site_Installer_Requirements_Check::met_requirements(); if ( is_wp_error( $requirements_met ) ) { return $requirements_met; } if ( empty( $request['products'] ) ) { return new WP_Error( 'missing_products', __( 'Missing products in request body.', 'woocommerce' ), array( 'status' => 400 ) ); } $validation_result = $this->validate_products( $request['products'] ); if ( is_wp_error( $validation_result ) ) { return $validation_result; } return rest_ensure_response( WC_WCCOM_Site_Installer::schedule_install( $request['products'] ) ); }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |