ms_allowed_http_request_hosts()
Adds any domain in a multisite installation for safe HTTP requests to the allowed list.
Attached to the http_request_host_is_external filter.
Хуков нет.
Возвращает
true|false.
Использование
ms_allowed_http_request_hosts( $is_external, $host );
- $is_external(true|false) (обязательный)
- .
- $host(строка) (обязательный)
- .
Заметки
- Global. wpdb.
$wpdbWordPress database abstraction object.
Список изменений
| С версии 3.6.0 | Введена. |
Код ms_allowed_http_request_hosts() ms allowed http request hosts WP 6.9.1
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 ];
}