exit_on_http_head WordPress Filter Hook

The exit_on_http_head hook allows a plugin to short-circuit the HTTP HEAD request method. This can be useful for cache plugins that need to quickly determine whether a page has changed before fetching it from the cache. It can also be used to prevent WordPress from loading unnecessary resources when all that is needed is the HTTP HEAD information.

apply_filters( 'exit_on_http_head', bool $exit ) #

Filters whether to allow ‘HEAD’ requests to generate content.


Description

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


Top ↑

Parameters

$exit

(bool)Whether to exit without generating any content for 'HEAD' requests. Default true.


Top ↑

Source

File: wp-includes/template-loader.php

View on Trac


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.