allowed_redirect_hosts WordPress Filter Hook

The allowed_redirect_hosts hook is used to specify a whitelist of domains that can be used for redirects. This is useful for preventing malicious redirects from third-party sites.

apply_filters( 'allowed_redirect_hosts', string[] $hosts, string $host ) #

Filters the list of allowed hosts to redirect to.


Parameters

$hosts

(string[])An array of allowed host names.

$host

(string)The host name of the redirect destination; empty string if not set.


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More