wp_remote_fopen()
wp_remote_fopen( string $uri ) 请求URI检索内容的HTTP请求。 HTTP r…
wp_remote_fopen( string $uri )
请求URI检索内容的HTTP请求。
HTTP request for URI to retrieve content.
目录锚点:#说明#参数#源码
说明(Description)
另请参阅wp_safe_remote_get()
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $uri | (string) | 要检索的网页的URI/URL。 |
源码(Source)
/**
* HTTP request for URI to retrieve content.
*
* @since 1.5.1
*
* @see wp_safe_remote_get()
*
* @param string $uri URI/URL of web page to retrieve.
* @return false|string HTTP content. False on failure.
*/
function wp_remote_fopen( $uri ) {
$parsed_url = @parse_url( $uri );
if ( !$parsed_url || !is_array( $parsed_url ) )
return false;
$options = array();
$options['timeout'] = 10;
$response = wp_safe_remote_get( $uri, $options );
if ( is_wp_error( $response ) )
return false;
return wp_remote_retrieve_body( $response );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.1 | wp-includes/functions.php | 9 | 20 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!