Warning: This method has been deprecated.

WP_Customize_Manager::wp_redirect_status() WordPress Method

The wp_redirect_status() function is used to set the HTTP status code for a page redirect. This is useful for indicating to the user that a page has moved or been deleted, for example. The status code can be any valid HTTP status code, such as "404 Not Found" or "301 Moved Permanently". The default status code is "302 Found".

WP_Customize_Manager::wp_redirect_status( int $status ) #

Prevents Ajax requests from following redirects when previewing a theme by issuing a 200 response instead of a 30x.


Description

Instead, the JS will sniff out the location header.


Top ↑

Parameters

$status

(int)(Required)Status.


Top ↑

Return

(int)


Top ↑

Source

File: wp-includes/class-wp-customize-manager.php

	public function wp_redirect_status( $status ) {
		_deprecated_function( __FUNCTION__, '4.7.0' );

		if ( $this->is_preview() && ! is_admin() ) {
			return 200;
		}

		return $status;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.7.0This method has been deprecated.
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.