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.5.2

apply_filters('allowed_redirect_hosts') is found 1 times:

  • /wp-includes/pluggable.php line 1625
    		 *
    		 * @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: