wp_remote_head
Retrieve the raw response from the HTTP request using the HEAD method.
Description
Returns (WP_Error|array)
The response or WP_Error on failure.
Parameters (2)
- 0. $url (string)
- Site URL to retrieve.
- 1. $args — Optional. (array) =>
array()
- Request arguments. Default empty array.
Usage
if ( !function_exists( 'wp_remote_head' ) ) { require_once ABSPATH . WPINC . '/http.php'; } // Site URL to retrieve. $url = ''; // Optional. Request arguments. Default empty array. $args = array(); // NOTICE! Understand what this does before running. $result = wp_remote_head($url, $args);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/http.php
- function wp_remote_head($url, $args = array()) {
- $http = _wp_http_get_object();
- return $http->head( $url, $args );
- }