Make WordPress Core


Ignore:
Timestamp:
09/14/2022 01:06:53 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct @return value for wp_get_http_headers().

Following the update to replace the HTTP API internals with Requests library in WordPress 4.6, the return value of wp_remote_retrieve_headers() has changed from a simple array to an object which implements ArrayAccess.

Since wp_get_http_headers() directly returns the result of wp_remote_retrieve_headers(), its return value should reflect that change.

Includes:

  • Updating the return value for the deprecated wp_get_http() function, which also directly returns the result of wp_remote_retrieve_headers().
  • Minor DocBlock formatting changes for some other HTTP API functions per the documentation standards.

Follow-up to [2416], [6390], [8092], [9013], [37428], [37989], [38730].

Props mhkuu.
See #54225, #55646.

File:
1 edited

Legend:

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

    r54146 r54157  
    979979 * @param string $url        URL to retrieve HTTP headers from.
    980980 * @param bool   $deprecated Not Used.
    981  * @return string|false Headers on success, false on failure.
     981 * @return \Requests_Utility_CaseInsensitiveDictionary|false Headers on success, false on failure.
    982982 */
    983983function wp_get_http_headers( $url, $deprecated = false ) {
Note: See TracChangeset for help on using the changeset viewer.