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.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код OnboardingSync::redirect_wccom_install() WC 8.9.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( 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() );
}