http_request_host_is_external
Filter HookDescription
Checks if HTTP request is external or not. Allows to change and allow external requests for the HTTP request.Hook Information
File Location |
wp-includes/http.php
View on GitHub
|
Hook Type | Filter |
Line Number | 607 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$external
|
Whether HTTP request is external or not. |
string
|
$host
|
Host name of the requested URL. |
string
|
$url
|
Requested URL. |
Usage Examples
Basic Usage
<?php
// Hook into http_request_host_is_external
add_filter('http_request_host_is_external', 'my_custom_filter', 10, 3);
function my_custom_filter($external, $host, $url) {
// Your custom filtering logic here
return $external;
}
Source Code Context
wp-includes/http.php:607
- How this hook is used in WordPress core
<?php
602 *
603 * @param bool $external Whether HTTP request is external or not.
604 * @param string $host Host name of the requested URL.
605 * @param string $url Requested URL.
606 */
607 if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {
608 return false;
609 }
610 }
611 }
612 }
PHP Documentation
<?php
/**
* Checks if HTTP request is external or not.
*
* Allows to change and allow external requests for the HTTP request.
*
* @since 3.6.0
*
* @param bool $external Whether HTTP request is external or not.
* @param string $host Host name of the requested URL.
* @param string $url Requested URL.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/http.php
Related Hooks
Related hooks will be displayed here in future updates.