WordPress at a glance
function is not described

ms_allowed_http_request_hosts() WP 3.6.0

Whitelists any domain in a multisite installation for safe HTTP requests.

Attached to the 'http_request_host_is_external' filter.

  • Global. wpdb. $wpdb WordPress database abstraction object.
  • Static. Array. $queried

No Hooks.

Return

true/false.

Usage

ms_allowed_http_request_hosts( $is_external, $host );
$is_external(true/false) (required)
$host(string) (required)

Code of ms allowed http request hosts: wp-includes/http.php WP 5.2.2

<?php
function ms_allowed_http_request_hosts( $is_external, $host ) {
	global $wpdb;
	static $queried = array();
	if ( $is_external ) {
		return $is_external;
	}
	if ( $host === get_network()->domain ) {
		return true;
	}
	if ( isset( $queried[ $host ] ) ) {
		return $queried[ $host ];
	}
	$queried[ $host ] = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM $wpdb->blogs WHERE domain = %s LIMIT 1", $host ) );
	return $queried[ $host ];
}