allowed_http_request_hosts

Whitelists allowed redirect hosts for safe HTTP requests as well.

Description

allowed_http_request_hosts( (bool) $is_external, (string) $host ); 

Attached to the http_request_host_is_external filter.

Parameters (2)

0. $is_external (bool)
The is external.
1. $host (string)
The host.

Usage

  1. if ( !function_exists( 'allowed_http_request_hosts' ) ) { 
  2. require_once ABSPATH . WPINC . '/http.php'; 
  3.  
  4. // The is external. 
  5. $is_external = true; 
  6.  
  7. // The host. 
  8. $host = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = allowed_http_request_hosts($is_external, $host); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/http.php  
  1. function allowed_http_request_hosts( $is_external, $host ) { 
  2. if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) ) 
  3. $is_external = true; 
  4. return $is_external;