Skip to content

Commit 24e8775

Browse files
committed
HTTP API: Update wp_http_supports() to use Requests.
Update the capabilities check in `wp_http_supports` to use `WpOrg\Requests\Requests::has_capabilities` rather than the deprecated `WP_HTTP::_get_first_available_transport()`. Props dd32, mukesh27, costdev, desrosj, johnbillion, jorbin, jrf, chaion07. Fixes #37708. git-svn-id: https://develop.svn.wordpress.org/trunk@58934 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 717ee4e commit 24e8775

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/wp-includes/http.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ function wp_remote_retrieve_cookie_value( $response, $name ) {
389389
* @return bool
390390
*/
391391
function wp_http_supports( $capabilities = array(), $url = null ) {
392-
$http = _wp_http_get_object();
393-
394392
$capabilities = wp_parse_args( $capabilities );
395393

396394
$count = count( $capabilities );
@@ -407,7 +405,7 @@ function wp_http_supports( $capabilities = array(), $url = null ) {
407405
}
408406
}
409407

410-
return (bool) $http->_get_first_available_transport( $capabilities );
408+
return WpOrg\Requests\Requests::has_capabilities( $capabilities );
411409
}
412410

413411
/**

0 commit comments

Comments
 (0)