mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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
This commit is contained in:
parent
7d4b63b317
commit
7009488561
@ -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'] ) ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user