On this page
wp_remote_retrieve_cookies( array|WP_Error $response ): WP_Http_Cookie[]
Retrieve only the cookies from the raw response.
Parameters
$responsearray|WP_Error Required-
HTTP response.
Return
WP_Http_Cookie[] An array of WP_Http_Cookie objects from the response.
Empty array if there are none, or the response is a WP_Error.
Source
File: wp-includes/http.php. View all references
function wp_remote_retrieve_cookies( $response ) {
if ( is_wp_error( $response ) || empty( $response['cookies'] ) ) {
return array();
}
return $response['cookies'];
}
Related
Uses
| Uses | Description |
|---|---|
| is_wp_error() wp-includes/load.php | Checks whether the given variable is a WordPress Error. |
Used By
| Used By | Description |
|---|---|
| wp_remote_retrieve_cookie() wp-includes/http.php | Retrieve a single cookie by name from the raw response. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookies