wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_remote_retrieve_headers › WordPress Function

Depuis2.7.0
Dépréciéen/a
wp_remote_retrieve_headers ( $response )
Paramètres:
  • (array|WP_Error) $response HTTP response.
    Requis: Oui
Voir:
  • WpOrgRequestsUtilityCaseInsensitiveDictionary
Retourne:
  • (WpOrgRequestsUtilityCaseInsensitiveDictionary|array) The headers of the response, or empty array if incorrect parameter given.
Défini(e) dans:
Codex:
Changelog:
  • 4.6.0

Retrieve only the headers from the raw response.



Source

function wp_remote_retrieve_headers( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return array();
	}

	return $response['headers'];
}