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



wp_remote_retrieve_response_message › WordPress Function

Depuis2.7.0
Dépréciéen/a
wp_remote_retrieve_response_message ( $response )
Paramètres:
  • (array|WP_Error) $response HTTP response.
    Requis: Oui
Retourne:
  • (string) The response message. Empty string if incorrect parameter given.
Défini(e) dans:
Codex:

Retrieve only the response message from the raw response.

Will return an empty string if incorrect parameter value is given.


Source

function wp_remote_retrieve_response_message( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {
		return '';
	}

	return $response['response']['message'];
}