Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_WCCOM_Site_Installer::download_product( int $product_id, WP_Upgrader $upgrader )
Download product by its ID and returns the path of the zip package.
Description Description
Parameters Parameters
- $product_id
-
(Required) Product ID.
- $upgrader
-
(Required) Core class to handle installation.
Return Return
(WP_Error|string)
Source Source
File: includes/wccom-site/class-wc-wccom-site-installer.php
private static function download_product( $product_id, $upgrader ) { $steps = self::get_state( 'steps' ); if ( empty( $steps[ $product_id ]['download_url'] ) ) { return new WP_Error( 'missing_download_url', __( 'Could not find download url for the product.', 'woocommerce' ) ); } return $upgrader->download_package( $steps[ $product_id ]['download_url'] ); }
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |