Summery Summery
Retrieve a single cookie by name from the raw response.
Syntax Syntax
Parameters Parameters
- $response
-
(Required) HTTP response.
- $name
-
(Required) The name of the cookie to retrieve.
Return Return
(WP_Http_Cookie|string) The WP_Http_Cookie
object. Empty string if the cookie isn't present in the response.
Source Source
File: wp-includes/http.php
if ( empty( $cookies ) ) { return ''; } foreach ( $cookies as $cookie ) { if ( $cookie->name === $name ) { return $cookie; } } return ''; } /**
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |