allowed_http_request_hosts() WordPress Function
The allowed_http_request_hosts() function is used to specify which hosts are allowed to make HTTP requests to the WordPress site. This is useful for restricting access to external sites or services.
allowed_http_request_hosts( bool $is_external, string $host ) #
Mark allowed redirect hosts safe for HTTP requests as well.
Description
Attached to the ‘http_request_host_is_external’ filter.
Parameters
- $is_external
(bool)(Required)
- $host
(string)(Required)
Return
(bool)
Source
File: wp-includes/http.php
function allowed_http_request_hosts( $is_external, $host ) {
if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) ) {
$is_external = true;
}
return $is_external;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |