wp_safe_remote_request
函数
wp_safe_remote_request ( $url, $args = array() )
- 参数
-
-
(string)
$url
URL to retrieve.- Required: 是
-
(array)
$args
Optional. Request arguments. Default empty array.- Required: 否
- Default: array()
-
(string)
- 返回值
-
- (array|WP_Error) The response or WP_Error on failure.
- 相关
-
- wp_remote_request()
- WP_Http::request()
- 定义位置
-
-
wp-includes/http.php
, line 44
-
wp-includes/http.php
- 引入
- 3.6.0
- 弃用
- –
Retrieve the raw response from a safe HTTP request.
This function is ideal when the HTTP request is being made to an arbitrary
URL. The URL is validated to avoid redirection and request forgery attacks.
function wp_safe_remote_request( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; $http = _wp_http_get_object(); return $http->request( $url, $args ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。