mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
When receiving a HEAD request, die() right before we start outputting content.
* Content doesn't make sense for HEAD requests * Saves wear and tear on the server * Introduces a filter: exit_on_http_head (we send TRUE through it) fixes #14348. props mbijon, mitchoyoshitaka. git-svn-id: http://core.svn.wordpress.org/trunk@22347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
57785c7fea
commit
08e68c1ec4
@ -6,6 +6,14 @@
|
||||
if ( defined('WP_USE_THEMES') && WP_USE_THEMES )
|
||||
do_action('template_redirect');
|
||||
|
||||
/**
|
||||
* Halt template load for HEAD requests. Performance bump by eliminating output
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) )
|
||||
exit();
|
||||
|
||||
// Process feeds and trackbacks even if not using themes.
|
||||
if ( is_robots() ) :
|
||||
do_action('do_robots');
|
||||
|
Loading…
Reference in New Issue
Block a user