Filter hook 'wp_redirect_status'

in WP Core File wp-includes/pluggable.php at line 1421

View Source

wp_redirect_status

Filter Hook
Description
Filters the redirect HTTP response status code to use.

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 1421

Hook Parameters

Type Name Description
int $status The HTTP response status code to use.
string $location The path or URL to redirect to.

Usage Examples

Basic Usage
<?php
// Hook into wp_redirect_status
add_filter('wp_redirect_status', 'my_custom_filter', 10, 2);

function my_custom_filter($status, $location) {
    // Your custom filtering logic here
    return $status;
}

Source Code Context

wp-includes/pluggable.php:1421 - How this hook is used in WordPress core
<?php
1416  		 * @since 2.3.0
1417  		 *
1418  		 * @param int    $status   The HTTP response status code to use.
1419  		 * @param string $location The path or URL to redirect to.
1420  		 */
1421  		$status = apply_filters( 'wp_redirect_status', $status, $location );
1422  
1423  		if ( ! $location ) {
1424  			return false;
1425  		}
1426  

PHP Documentation

<?php
/**
		 * Filters the redirect HTTP response status code to use.
		 *
		 * @since 2.3.0
		 *
		 * @param int    $status   The HTTP response status code to use.
		 * @param string $location The path or URL to redirect to.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.