Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingJetpack::activate_and_install_jetpack_ahead_of_wcpay()publicWC 1.0

Ensure that Jetpack gets installed and activated ahead of WooCommerce Payments if both are being installed/activated at the same time.

See: https://github.com/Automattic/woocommerce-payments/issues/1663 See: https://github.com/Automattic/jetpack/issues/19624

{} Это метод класса: OnboardingJetpack{}

Хуков нет.

Возвращает

Массив.

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

$OnboardingJetpack = new OnboardingJetpack();
$OnboardingJetpack->activate_and_install_jetpack_ahead_of_wcpay( $plugins );
$plugins(массив) (обязательный)
A list of plugins to install or activate.

Код OnboardingJetpack::activate_and_install_jetpack_ahead_of_wcpay() WC 6.6.1

public function activate_and_install_jetpack_ahead_of_wcpay( $plugins ) {
	if ( in_array( 'jetpack', $plugins, true ) && in_array( 'woocommerce-payments', $plugins, true ) ) {
		array_unshift( $plugins, 'jetpack' );
		$plugins = array_unique( $plugins );
	}
	return $plugins;
}