allowed_redirect_hosts

allowed_redirect_hosts

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('allowed_redirect_hosts') is found 1 times:

  • /wp-includes/pluggable.php line 1625
    1621
    1622
    1623
    1624
    1625
    1626
    1627
    1628
    1629
    1630
    1631
    *
     * @param string[] $hosts An array of allowed host names.
     * @param string   $host  The host name of the redirect destination; empty string if not set.
     */
    $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
     
    if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts, true ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) {
        $location = $fallback_url;
    }
     
    return $location;

See this hook used in plugins: