Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingSync::redirect_wccom_install()publicWC 1.0

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

Method of the class: OnboardingSync{}

No Hooks.

Return

null. Nothing (null).

Usage

$OnboardingSync = new OnboardingSync();
$OnboardingSync->redirect_wccom_install();

OnboardingSync::redirect_wccom_install() code WC 9.4.2

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

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

	wp_safe_redirect( wc_admin_url() );
}