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



wp_remote_retrieve_cookies › WordPress Function

Since4.4.0
Deprecatedn/a
wp_remote_retrieve_cookies ( $response )
Parameters:
  • (array|WP_Error) $response HTTP response.
    Required: Yes
Returns:
  • (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.
Defined at:
Codex:

Retrieves only the cookies from the raw response.



Source

function wp_remote_retrieve_cookies( $response ) {
	if ( is_wp_error( $response ) || empty( $response['cookies'] ) ) {
		return array();
	}

	return $response['cookies'];
}