wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_remote_retrieve_header › WordPress Function

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:
  • (array|string) The header(s) value(s). Array if multiple headers with the same name are retrieved. Empty string 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 '';
}