Make WordPress Core

Changeset 58934


Ignore:
Timestamp:
08/25/2024 11:11:02 PM (7 weeks ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/http.php

    r58682 r58934  
    390390 */
    391391function wp_http_supports( $capabilities = array(), $url = null ) {
    392     $http = _wp_http_get_object();
    393 
    394392    $capabilities = wp_parse_args( $capabilities );
    395393
     
    408406    }
    409407
    410     return (bool) $http->_get_first_available_transport( $capabilities );
     408    return WpOrg\Requests\Requests::has_capabilities( $capabilities );
    411409}
    412410
Note: See TracChangeset for help on using the changeset viewer.