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.

Built from https://develop.svn.wordpress.org/trunk@58934


git-svn-id: http://core.svn.wordpress.org/trunk@58330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2024-08-25 23:13:17 +00:00
parent a0e8d31590
commit fd94bc45c6
2 changed files with 2 additions and 4 deletions

View File

@ -389,8 +389,6 @@ function wp_remote_retrieve_cookie_value( $response, $name ) {
* @return bool
*/
function wp_http_supports( $capabilities = array(), $url = null ) {
$http = _wp_http_get_object();
$capabilities = wp_parse_args( $capabilities );
$count = count( $capabilities );
@ -407,7 +405,7 @@ function wp_http_supports( $capabilities = array(), $url = null ) {
}
}
return (bool) $http->_get_first_available_transport( $capabilities );
return WpOrg\Requests\Requests::has_capabilities( $capabilities );
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-alpha-58933';
$wp_version = '6.7-alpha-58934';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.