Make WordPress Core

Ticket #14348: 14348-7.diff

File 14348-7.diff, 1.7 KB (added by kurtpayne, 13 years ago)

Alternate patch

  • wordpress/wp-includes/default-filters.php

     
    282282add_action( 'admin_init', 'register_admin_color_schemes', 1);
    283283add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    284284
     285// Quit early on HEAD requests
     286add_action( 'head_request', 'handle_head_request' );
     287
    285288unset($filter, $action);
  • wordpress/wp-includes/functions.php

     
    36073607        return true;
    36083608}
    36093609
     3610/**
     3611 * Halt template load for HEAD requests. Performance bump by eliminating output
     3612 *
     3613 * @since 3.5.0
     3614 */
     3615function handle_head_request() {       
     3616        if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
     3617                $function = create_function( '', "return '_scalar_wp_die_handler';" );
     3618                add_filter( 'wp_die_handler', $function );
     3619                wp_die();
     3620        }
     3621}
  • wordpress/wp-includes/template-loader.php

     
    66if ( defined('WP_USE_THEMES') && WP_USE_THEMES )
    77        do_action('template_redirect');
    88
     9/**
     10 * Halt template load for HEAD requests. Performance bump by eliminating output
     11 *
     12 * @since 3.5.0
     13 */
     14do_action( 'head_request' );
     15
    916// Process feeds and trackbacks even if not using themes.
    1017if ( is_robots() ) :
    1118        do_action('do_robots');