exit_on_http_head
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.
Использование
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.
По умолчанию: true
Список изменений
С версии 3.5.0 | Введена. |
Где вызывается хук
В файле: /wp-includes/template-loader.php
wp-includes/template-loader.php 26
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {