wp_redirect WordPress Filter Hook
The wp_redirect hook allows you to redirect a user to a different URL than the one they were originally trying to access. This can be useful for a number of different things, such as redirecting a user to a login page if they are not logged in, or redirecting a user to a different page if they do not have access to the one they were trying to view.
apply_filters( 'wp_redirect', string $location , int $status ) #
Filters the redirect location.
Parameters
- $location
(string)The path or URL to redirect to.
- $status
(int)The HTTP response status code to use.
Source
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |