Automattic\WooCommerce\Admin\API

OnboardingPlugins::install_and_activate()publicWC 1.0

Install and activate a plugin.

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

Хуков нет.

Возвращает

WP_REST_Response.

Использование

$OnboardingPlugins = new OnboardingPlugins();
$OnboardingPlugins->install_and_activate( $request );
$request(WP_REST_Request) (обязательный)
WP Request object.

Код OnboardingPlugins::install_and_activate() WC 9.3.3

public function install_and_activate( WP_REST_Request $request ) {
	$response             = array();
	$response['install']  = PluginsHelper::install_plugins( $request->get_param( 'plugins' ) );
	$response['activate'] = PluginsHelper::activate_plugins( $response['install']['installed'] );

	return new WP_REST_Response( $response );
}