PUM_Admin_Onboarding::welcome_redirect()

Redirect to the welcome screen, if needed


Description Description


Source Source

File: classes/Admin/Onboarding.php

	public static function welcome_redirect() {
		// Redirect idea from Better Click To Tweet's welcome screen. Thanks Ben!
		if ( get_transient( 'pum_activation_redirect' ) ) {
			$do_redirect  = true;
			$current_page = isset( $_GET['page'] ) ? wp_unslash( $_GET['page'] ) : false;
			// Bailout redirect during these events.
			if ( wp_doing_ajax() || is_network_admin() || ! current_user_can( 'manage_options' ) ) {
				$do_redirect = false;
			}
			// Bailout redirect on these pages & events.
			if ( 'pum-welcome' === $current_page || isset( $_GET['activate-multi'] ) ) {
				delete_transient( 'pum_activation_redirect' );
				$do_redirect = false;
			}
			if ( $do_redirect ) {
				delete_transient( 'pum_activation_redirect' );
				update_option( 'pum_seen_welcome', 1 );
				wp_safe_redirect( admin_url( 'admin.php?page=pum-welcome' ) );
				exit;
			}
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.14.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.