x_redirect_by
Filters the X-Redirect-By header.
Allows applications to identify themselves when they're doing a redirect.
Usage
add_filter( 'x_redirect_by', 'wp_kama_x_redirect_by_filter', 10, 3 );
/**
* Function for `x_redirect_by` filter-hook.
*
* @param string|false $x_redirect_by The application doing the redirect or false to omit the header.
* @param int $status Status code to use.
* @param string $location The path to redirect to.
*
* @return string|false
*/
function wp_kama_x_redirect_by_filter( $x_redirect_by, $status, $location ){
// filter...
return $x_redirect_by;
}
- $x_redirect_by(string|false)
- The application doing the redirect or false to omit the header.
- $status(int)
- Status code to use.
- $location(string)
- The path to redirect to.
Changelog
| Since 5.1.0 | Introduced. |
Where the hook is called
wp-includes/pluggable.php 1529
$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );