* @access public
* @since 2.7.0
*
- * @global string $wp_version
- *
* @param string $url The request URL.
* @param string|array $args {
* Optional. Array or string of HTTP request arguments.
* @type string $httpversion Version of the HTTP protocol to use. Accepts '1.0' and '1.1'.
* Default '1.0'.
* @type string $user-agent User-agent value sent.
- * Default WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ).
+ * Default WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ).
* @type bool $reject_unsafe_urls Whether to pass URLs through wp_http_validate_url().
* Default false.
* @type bool $blocking Whether the calling code requires the result of the request.
* A WP_Error instance upon error.
*/
public function request( $url, $args = array() ) {
- global $wp_version;
-
$defaults = array(
'method' => 'GET',
/**
*
* @param string $user_agent WordPress user agent string.
*/
- 'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
+ 'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) ),
/**
* Filters whether to pass URLs through wp_http_validate_url() in an HTTP request.
*
'timeout' => $r['timeout'],
'useragent' => $r['user-agent'],
'blocking' => $r['blocking'],
- 'hooks' => new Requests_Hooks(),
+ 'hooks' => new WP_HTTP_Requests_Hooks( $url, $r ),
);
// Ensure redirects follow browser behaviour.