From 700948856171be3d2a358a74ee4da7caba624156 Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Tue, 4 Jan 2022 18:52:43 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@52441 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/http.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/http.php b/src/wp-includes/http.php index d76298368f..4981875968 100644 --- a/src/wp-includes/http.php +++ b/src/wp-includes/http.php @@ -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'] ) ) {