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

redirect_this_site

Definition:
function redirect_this_site( $deprecated = '' ) {}

Ensure that the current site’s domain is listed in the allowed redirect host list.

Parameters

  • $deprecated

Return values

returns:The current site’s domain

Source code

function redirect_this_site( $deprecated = '' ) {

	global $current_site;

	return array( $current_site->domain );

}

2647

redirect_post

Definition:
function redirect_post($post_id = '') {}

Redirect to previous page.

Parameters

  • int $post_id: Optional. Post ID.

Defined filters

  • redirect_post_location
    apply_filters( 'redirect_post_location', $location, $post_id )

Source code

function redirect_post($post_id = '') {

	if ( isset($_POST['save']) || isset($_POST['publish']) ) {

		$status = get_post_status( $post_id );



		if ( isset( $_POST['publish'] ) ) {

			switch ( $status ) {

				case 'pending':

					$message = 8;

					break;

				case 'future':

					$message = 9;

					break;

				default:

					$message = 6;

			}

		} else {

				$message = 'draft' == $status ? 10 : 1;

		}



		$location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );

	} elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {

		$location = add_query_arg( 'message', 2, wp_get_referer() );

		$location = explode('#', $location);

		$location = $location[0] . '#postcustom';

	} elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {

		$location = add_query_arg( 'message', 3, wp_get_referer() );

		$location = explode('#', $location);

		$location = $location[0] . '#postcustom';

	} elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {

		$location = "post.php?action=edit&post=$post_id&message=7";

	} else {

		$location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );

	}



	wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );

	exit;

}

2645

redirect_old_akismet_urls

Definition:
function redirect_old_akismet_urls( ) {}

Source code

function redirect_old_akismet_urls( ) {

	global $wp_db_version;

	$script_name = array_pop( split( '/', $_SERVER['PHP_SELF'] ) );



	$page = '';

	if ( !empty( $_GET['page'] ) )

		$page = $_GET['page'];



	// 2.7 redirect for people who might have bookmarked the old page

	if ( 8204 < $wp_db_version && ( 'edit-comments.php' == $script_name || 'edit.php' == $script_name ) && 'akismet-admin' == $page ) {

		$new_url = esc_url( 'edit-comments.php?comment_status=spam' );

		wp_redirect( $new_url, 301 );

		exit;

	}

}

2643

redirect_mu_dashboard

Definition:
function redirect_mu_dashboard() {}

Source code

function redirect_mu_dashboard() {

	global $current_site, $current_blog;



	$dashboard_blog = get_dashboard_blog();

	if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {

		$protocol = ( is_ssl() ? 'https://' : 'http://' );

		wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' );

		die();

	}

}

2641