WC_Helper::current_screen()public staticWC 1.0

Various early-phase actions with possible redirects.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Helper::current_screen( $screen );
$screen(object) (required)
WP screen object.

Code of WC_Helper::current_screen() WC 6.6.1

public static function current_screen( $screen ) {
	$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );

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

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