exit_on_http_head filter-hookWP 3.5.0

Filters whether to allow 'HEAD' requests to generate content.

Provides a significant performance bump by exiting before the page content loads for 'HEAD' requests. See #14348.

Usage

add_filter( 'exit_on_http_head', 'wp_kama_exit_on_http_head_filter' );

/**
 * Function for `exit_on_http_head` filter-hook.
 * 
 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests.
 *
 * @return bool
 */
function wp_kama_exit_on_http_head_filter( $exit ){

	// filter...
	return $exit;
}
$exit(true|false)
Whether to exit without generating any content for 'HEAD' requests.
Default: true

Changelog

Since 3.5.0 Introduced.

Where the hook is called

In file: /wp-includes/template-loader.php
exit_on_http_head
wp-includes/template-loader.php 26
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {

Where the hook is used in WordPress

Usage not found.