WordPress at Your Fingertips
function is not described

WC_WCCOM_Site_Installer::install() public WC 3.7.0

Install a given product IDs.

Run via woocommerce_wccom_install_products hook.

{} It's a method of the class: WC_WCCOM_Site_Installer{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_WCCOM_Site_Installer::install( $products );
$products(array) (required)
Array of products where key is product ID and element is install args.

Changelog

Since 3.7.0 Introduced.

Code of WC_WCCOM_Site_Installer::install() WC 5.7.1

public static function install( $products ) {
	require_once ABSPATH . 'wp-admin/includes/file.php';
	require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
	require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
	require_once ABSPATH . 'wp-admin/includes/plugin.php';

	WP_Filesystem();
	$upgrader = new WP_Upgrader( new Automatic_Upgrader_Skin() );
	$upgrader->init();
	wp_clean_plugins_cache();

	foreach ( $products as $product_id => $install_args ) {
		self::install_product( $product_id, $install_args, $upgrader );
	}

	self::finish_installation();
}