Make WordPress Core


Ignore:
Timestamp:
01/04/2022 06:52:43 PM (2 years ago)
Author:
davidbaumwald
Message:

HTTP API: Improve docs for wp_remote_retrieve_header function return value.

This change updates the @return docs for wp_remote_retrieve_header to specify that an array can also be returned if the requested header key has multiple values.

Props robtarr, johnjamesjacoby, felipeelia, hellofromTonya, costdev.
Fixes #51736.

File:
1 edited

Legend:

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

    r52328 r52441  
    223223 * @param array|WP_Error $response HTTP response.
    224224 * @param string         $header   Header name to retrieve value from.
    225  * @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
     225 * @return array|string The header(s) value(s). Array if multiple headers with the same name are retrieved.
     226 *                      Empty string if incorrect parameter given, or if the header doesn't exist.
    226227 */
    227228function wp_remote_retrieve_header( $response, $header ) {
Note: See TracChangeset for help on using the changeset viewer.