http_request_host_is_external filter-hookWP 3.6.0

Checks if HTTP request is external or not.

Allows to change and allow external requests for the HTTP request.

Usage

add_filter( 'http_request_host_is_external', 'wp_kama_http_request_host_is_external_filter', 10, 3 );

/**
 * Function for `http_request_host_is_external` filter-hook.
 * 
 * @param bool   $external Whether HTTP request is external or not.
 * @param string $host     Host name of the requested URL.
 * @param string $url      Requested URL.
 *
 * @return bool
 */
function wp_kama_http_request_host_is_external_filter( $external, $host, $url ){

	// filter...
	return $external;
}
$external(true|false)
Whether HTTP request is external or not.
$host(string)
Host name of the requested URL.
$url(string)
Requested URL.

Changelog

Since 3.6.0 Introduced.

Where the hook is called

wp_http_validate_url()
http_request_host_is_external
wp-includes/http.php 614
if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {

Where the hook is used in WordPress

wp-includes/default-filters.php 317
add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );
wp-includes/ms-default-filters.php 133
add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 );