redirect_user_to_blog

Definition:
function redirect_user_to_blog() {}

Source code

function redirect_user_to_blog() {

	$c = 0;

	if ( isset( $_GET['c'] ) )

		$c = (int) $_GET['c'];



	if ( $c >= 5 ) {

		wp_die( __( "You don’t have permission to view this site. Please contact the system administrator." ) );

	}

	$c ++;



	$blog = get_active_blog_for_user( get_current_user_id() );



	if ( is_object( $blog ) ) {

		wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case"

	} else {

		wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case"

	}

	exit;

}

2649

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: