WordPress at Your Fingertips
function is not described

WC_WCCOM_Site_Installer::schedule_install() public WC 3.7.0

Schedule installing given list of products.

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

No Hooks.

Return

Array. State.

Usage

$result = WC_WCCOM_Site_Installer::schedule_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::schedule_install() WC 5.8.0

public static function schedule_install( $products ) {
	$state  = self::get_state();
	$status = ! empty( $state['status'] ) ? $state['status'] : '';
	if ( 'in-progress' === $status ) {
		return $state;
	}
	self::update_state( 'status', 'in-progress' );

	$steps = array_fill_keys( array_keys( $products ), self::$default_step_state );
	self::update_state( 'steps', $steps );

	self::update_state( 'current_step', null );

	$args = array(
		'products' => $products,
	);

	// Clear the cache of customer's subscription before asking for them.
	// Thus, they will be re-fetched from WooCommerce.com after a purchase.
	WC_Helper::_flush_subscriptions_cache();

	WC()->queue()->cancel_all( 'woocommerce_wccom_install_products', $args );
	WC()->queue()->add( 'woocommerce_wccom_install_products', $args );

	return self::get_state();
}