wp_redirect_status
Filters the redirect HTTP response status code to use.
Usage
add_filter( 'wp_redirect_status', 'wp_kama_redirect_status_filter', 10, 2 ); /** * Function for `wp_redirect_status` filter-hook. * * @param int $status The HTTP response status code to use. * @param string $location The path or URL to redirect to. * * @return int */ function wp_kama_redirect_status_filter( $status, $location ){ // filter... return $status; }
- $status(int)
- The HTTP response status code to use.
- $location(string)
- The path or URL to redirect to.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
wp-includes/pluggable.php 1406
$status = apply_filters( 'wp_redirect_status', $status, $location );