Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_remote_retrieve_cookie_value ›

Desde4.4.0
Obsoleton/a
wp_remote_retrieve_cookie_value ( $response, $name )
Parâmetros: (2)
  • (array) $response HTTP response.
    Required: Yes
  • (string) $name The name of the cookie to retrieve.
    Required: Yes
Retorna:
  • (string) The value of the cookie. Empty string if the cookie isn't present in the response.
Definido em:
Codex:

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



Fonte

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

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

	return $cookie->value;
}