From fd94bc45c6329ea1e8f8f64ff1a2ecb9cce4621c Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sun, 25 Aug 2024 23:13:17 +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. Built from https://develop.svn.wordpress.org/trunk@58934 git-svn-id: http://core.svn.wordpress.org/trunk@58330 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 4 +--- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 26a0fc3a7e..240fd03795 100644 --- a/wp-includes/http.php +++ b/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 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 97bed631a2..007c511f7a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.