x_redirect_by
Filters the value of the X-Redirect-By HTTP header.
Allows applications to identify themselves when they're doing a redirect.
Использование
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(строка|false)
- The application doing the redirect or false to omit the header.
- $status(int)
- Status code to use.
- $location(строка)
- The path to redirect to.
Список изменений
| С версии 5.1.0 | Введена. |
Где вызывается хук
wp-includes/pluggable.php 1533
$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );