Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_remote_retrieve_cookie_value ›

Da4.4.0
Deprecaton/a
wp_remote_retrieve_cookie_value ( $response, $name )
Parametri: (2)
  • (array) $response HTTP response.
    Richiesto:
  • (string) $name The name of the cookie to retrieve.
    Richiesto:
Ritorna:
  • (string) The value of the cookie. Empty string if the cookie isn't present in the response.
Definito a:
Codex:

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



Sorgenti

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;
}