wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_remote_retrieve_cookie_value › WordPress Function

Since4.4.0
Deprecatedn/a
wp_remote_retrieve_cookie_value ( $response, $name )
Parameters: (2)
  • (array|WP_Error) $response HTTP response.
    Required: Yes
  • (string) $name The name of the cookie to retrieve.
    Required: Yes
Returns:
  • (string) The value of the cookie, or empty string if the cookie is not present in the response.
Defined at:
Codex:

Retrieve a single cookie's value by name from the raw response.



Source

function wp_remote_retrieve_cookie_value( $response, $name ) {
	$cookie = wp_remote_retrieve_cookie( $response, $name );

	if ( ! ( $cookie instanceof WP_Http_Cookie ) ) {
		return '';
	}

	return $cookie->value;
}