Automattic\WooCommerce\Admin

PluginsHelper::schedule_install_plugins()public staticWC 1.0

Schedule plugin installation.

Метод класса: PluginsHelper{}

No Hooks.

Return

String. Job ID.

Usage

$result = PluginsHelper::schedule_install_plugins( $plugins );
$plugins(array) (required)
Plugins to install.

Code of PluginsHelper::schedule_install_plugins() WC 7.1.0

public static function schedule_install_plugins( $plugins ) {
	if ( empty( $plugins ) || ! is_array( $plugins ) ) {
		return new \WP_Error( 'woocommerce_plugins_invalid_plugins', __( 'Plugins must be a non-empty array.', 'woocommerce' ), 404 );
	}

	$job_id = uniqid();
	WC()->queue()->schedule_single( time() + 5, 'woocommerce_plugins_install_callback', array( $plugins, $job_id ) );

	return $job_id;
}