From 24e87757cd068b29df98c9f6ae464baaf4659670 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sun, 25 Aug 2024 23:11:02 +0000 Subject: [PATCH] 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 --- src/wp-includes/http.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php index 26a0fc3a7e5a3..240fd0379500a 100644 --- a/src/wp-includes/http.php +++ b/src/wp-includes/http.php @@ -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 ); } /**