Automattic\WooCommerce\Admin\Features

Onboarding::redirect_wccom_install()public staticWC 1.0

Redirects the user to the task list if the task list is enabled and finishing a wccom checkout.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = Onboarding::redirect_wccom_install();

Код Onboarding::redirect_wccom_install() WC 6.4.1

public static function redirect_wccom_install() {
	$task_list = TaskLists::get_list( 'setup' );

	if (
		! $task_list ||
		$task_list->is_hidden() ||
		! isset( $_SERVER['HTTP_REFERER'] ) ||
		0 !== strpos( $_SERVER['HTTP_REFERER'], 'https://woocommerce.com/checkout?utm_medium=product' ) // phpcs:ignore sanitization ok.
	) {
		return;
	}

	wp_safe_redirect( wc_admin_url() );
}