функция
since 3.6.0
ms_allowed_http_request_hosts()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
ms_allowed_http_request_hosts( bool $is_external, string $host ): bool
Описание
Подключается к фильтру ‘http_request_host_is_external’.
Оригинал (английский)
Attached to the ‘http_request_host_is_external’ filter.
Параметры
$is_external
bool
обязательный
$host
string
обязательный
Возвращаемое значение
bool
Исходный код
wp-includes/http.php:683
function ms_allowed_http_request_hosts( $is_external, $host ) {
global $wpdb;
static $queried = array();
if ( $is_external ) {
return $is_external;
}
if ( get_network()->domain === $host ) {
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 ];
}
История изменений
| Версия | Описание |
|---|---|
| 3.6.0 | Introduced. |

