ms_allowed_http_request_hosts
函数
ms_allowed_http_request_hosts ( $is_external, $host )
- 参数
-
-
(bool)
$is_external- Required: 是
-
(string)
$host- Required: 是
-
(bool)
- 返回值
-
- (bool)
- 定义位置
-
-
wp-includes/http.php
, line 644
-
wp-includes/http.php
- 引入
- 3.6.0
- 弃用
- –
Adds any domain in a multisite installation for safe HTTP requests to the
allowed list.
Attached to the {@see ‘http_request_host_is_external’} filter.
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 ];
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。