apply_filters( 'allowed_redirect_hosts', array $hosts , bool|string $host )
Filters the whitelist of hosts to redirect to.
Description Description
Parameters Parameters
- $hosts
-
(array) An array of allowed hosts.
- $host
-
(bool|string) The parsed host; empty if not isset.
Source Source
Changelog Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Allow additional redirect hosts
You can allow additional hosts when validating redirects by using the allowed_redirect_hosts filter.
function my_allowed_redirect_hosts( $hosts ) { $my_hosts = array( 'blog.example.com', 'codex.example.com', ); return array_merge( $hosts, $my_hosts ); }; add_filter( 'allowed_redirect_hosts', 'my_allowed_redirect_hosts' );