A WordPress-centric search engine for devs and theme authors



wp_remote_retrieve_response_message ›

Since2.7.0
Deprecatedn/a
wp_remote_retrieve_response_message ( $response )
Parameters:
  • (array) $response HTTP response.
    Required: Yes
Returns:
  • (string) The response message. Empty string on incorrect parameter given.
Defined at:
Codex:

Retrieve only the response message from the raw response.

Will return an empty array 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'];
}