A WordPress-centric search engine for devs and theme authors



wp_remote_retrieve_cookies ›

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

Retrieve 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'];
}