http_request_host_is_external
Checks if HTTP request is external or not.
Allows to change and allow external requests for the HTTP request.
Использование
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(строка)
- Host name of the requested URL.
- $url(строка)
- Requested URL.
Список изменений
С версии 3.6.0 | Введена. |
Где вызывается хук
http_request_host_is_external
wp-includes/http.php 607
if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {
Где используется хук в WordPress
wp-includes/default-filters.php 320
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 );