Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_remote_retrieve_header ›

Da2.7.0
Deprecaton/a
wp_remote_retrieve_header ( $response, $header )
Parametri: (2)
  • (array|WP_Error) $response HTTP response.
    Richiesto:
  • (string) $header Header name to retrieve value from.
    Richiesto:
Ritorna:
  • (string) The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
Definito a:
Codex:

Retrieve a single header by name from the raw response.



Sorgenti

function wp_remote_retrieve_header( $response, $header ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return '';
	}

	if ( isset( $response['headers'][ $header ] ) ) {
		return $response['headers'][ $header ];
	}

	return '';
}