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.
Built from https://develop.svn.wordpress.org/trunk@52441


git-svn-id: http://core.svn.wordpress.org/trunk@52033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2022-01-04 18:54:00 +00:00
parent 79a705c8d8
commit 5d9af9adac
2 changed files with 3 additions and 2 deletions

View File

@ -222,7 +222,8 @@ function wp_remote_retrieve_headers( $response ) {
*
* @param array|WP_Error $response HTTP response.
* @param string $header Header name to retrieve value from.
* @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
* @return array|string The header(s) value(s). Array if multiple headers with the same name are retrieved.
* Empty string if incorrect parameter given, or if the header doesn't exist.
*/
function wp_remote_retrieve_header( $response, $header ) {
if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta4-52440';
$wp_version = '5.9-beta4-52441';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.