Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_remote_retrieve_response_code ›

Da2.7.0
Deprecaton/a
wp_remote_retrieve_response_code ( $response )
Parametri:
  • (array|WP_Error) $response HTTP response.
    Richiesto:
Ritorna:
  • (int|string) The response code as an integer. Empty string on incorrect parameter given.
Definito a:
Codex:

Retrieve only the response code from the raw response.

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



Sorgenti

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

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