WC_WCCOM_Site_Installer::unpack_product()private staticWC 3.7.0

Unpack downloaded product.

Method of the class: WC_WCCOM_Site_Installer{}

No Hooks.

Return

\WP_Error|String.

Usage

$result = WC_WCCOM_Site_Installer::unpack_product( $product_id, $upgrader );
$product_id(int) (required)
Product ID.
$upgrader(\WP_Upgrader) (required)
Core class to handle installation.

Changelog

Since 3.7.0 Introduced.

WC_WCCOM_Site_Installer::unpack_product() code WC 7.7.0

private static function unpack_product( $product_id, $upgrader ) {
	$steps = self::get_state( 'steps' );
	if ( empty( $steps[ $product_id ]['download_path'] ) ) {
		return new WP_Error( 'missing_download_path', __( 'Could not find download path.', 'woocommerce' ) );
	}

	return $upgrader->unpack_package( $steps[ $product_id ]['download_path'], true );
}