wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_remote_fopen › WordPress Function
Since1.5.1
已弃用n/a
› wp_remote_fopen ( $uri )
参数: |
|
查看: | |
返回: |
|
定义在: |
|
文档: |
HTTP request for URI to retrieve content.
Related Functions: wp_remote_get, wp_remote_post, wp_remote_head, wp_remote_request, wp_safe_remote_get
源码
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 ); }