WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin\Features

Onboarding::admin_redirects() public WC 1.0

Handle redirects to setup/welcome page after install and updates.

For setup wizard, transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.

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

Возвращает

Null. Ничего.

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

$Onboarding = new Onboarding();
$Onboarding->admin_redirects();

Код Onboarding::admin_redirects() WC 4.7.1

<?php
public function admin_redirects() {
	// Don't run this fn from Action Scheduler requests, as it would clear _wc_activation_redirect transient.
	// That means OBW would never be shown.
	if ( self::is_running_from_async_action_scheduler() ) {
		return;
	}

	// Setup wizard redirect.
	if ( get_transient( '_wc_activation_redirect' ) && apply_filters( 'woocommerce_enable_setup_wizard', true ) ) {
		$do_redirect        = true;
		$current_page       = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification
		$is_onboarding_path = ! isset( $_GET['path'] ) || '/setup-wizard' === wc_clean( wp_unslash( $_GET['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification

		// On these pages, or during these events, postpone the redirect.
		if ( wp_doing_ajax() || is_network_admin() || ! current_user_can( 'manage_woocommerce' ) ) {
			$do_redirect = false;
		}

		// On these pages, or during these events, disable the redirect.
		if (
			( 'wc-admin' === $current_page && $is_onboarding_path ) ||
			apply_filters( 'woocommerce_prevent_automatic_wizard_redirect', false ) ||
			isset( $_GET['activate-multi'] ) // phpcs:ignore WordPress.Security.NonceVerification
		) {
			delete_transient( '_wc_activation_redirect' );
			$do_redirect = false;
		}

		if ( $do_redirect ) {
			delete_transient( '_wc_activation_redirect' );
			wp_safe_redirect( wc_admin_url() );
			exit;
		}
	}
}