WordPress at a glance

wp_remote_retrieve_response_message() WP 1.0

Retrieve only the response message from the raw response.

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

Возвращает

String. The response message. Empty string on incorrect parameter given.

No Hooks.

Usage

wp_remote_retrieve_response_message( $response );
$response(array/WP_Error) (required)
HTTP response.

Список изменений

С версии 2.7.0 Введена.

Code of wp_remote_retrieve_response_message() WP 5.5.1

wp-includes/http.php
<?php
function wp_remote_retrieve_response_message( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) {
		return '';
	}

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

Related Functions

From tag: HTTP API (curl remote)

No comments
    Log In . Register