WC_Helper::current_screen()public staticWC 1.0

Various early-phase actions with possible redirects.

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

Хуков нет.

Возвращает

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

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

$result = WC_Helper::current_screen( $screen );
$screen(объект) (обязательный)
WP screen object.

Код WC_Helper::current_screen() WC 8.7.0

public static function current_screen( $screen ) {
	$wc_screen_id = 'woocommerce';

	if ( $wc_screen_id . '_page_wc-addons' !== $screen->id ) {
		return;
	}

	self::maybe_redirect_to_new_marketplace_installer();

	if ( empty( $_GET['section'] ) || 'helper' !== $_GET['section'] ) {
		return;
	}

	if ( ! empty( $_GET['wc-helper-connect'] ) ) {
		return self::_helper_auth_connect();
	}

	if ( ! empty( $_GET['wc-helper-return'] ) ) {
		return self::_helper_auth_return();
	}

	if ( ! empty( $_GET['wc-helper-disconnect'] ) ) {
		return self::_helper_auth_disconnect();
	}

	if ( ! empty( $_GET['wc-helper-refresh'] ) ) {
		return self::_helper_auth_refresh();
	}

	if ( ! empty( $_GET['wc-helper-activate'] ) ) {
		return self::_helper_subscription_activate();
	}

	if ( ! empty( $_GET['wc-helper-deactivate'] ) ) {
		return self::helper_subscription_deactivate();
	}

	if ( ! empty( $_GET['wc-helper-deactivate-plugin'] ) ) {
		return self::_helper_plugin_deactivate();
	}
}