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.

{} It's a method of the class: OnboardingSync{}

No Hooks.

Return

null. Nothing.

Usage

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

Code of OnboardingSync::redirect_wccom_install() WC 7.1.0

public 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() );
}