WordPress.org

Make WordPress Core

Ticket #25488: 25488.2.patch

File 25488.2.patch, 1.6 KB (added by DrewAPicture, 6 years ago)

Final

  • src/wp-includes/template-loader.php

     
    44 * @package WordPress
    55 */
    66if ( defined('WP_USE_THEMES') && WP_USE_THEMES )
    7         do_action('template_redirect');
     7        /**
     8         * Fires before determining which template to load.
     9         *
     10         * @since 1.5.2
     11         */
     12        do_action( 'template_redirect' );
    813
    9 // Halt template load for HEAD requests. Performance bump. See #14348
     14/**
     15 * Filter whether to allow 'HEAD' requests to generate content.
     16 *
     17 * Provides a significant performance bump by exiting before the page
     18 * content loads for 'HEAD' requests. See #14348.
     19 *
     20 * @since 3.5.0
     21 *
     22 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
     23 */
    1024if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) )
    1125        exit();
    1226
    1327// Process feeds and trackbacks even if not using themes.
    1428if ( is_robots() ) :
    15         do_action('do_robots');
     29        /**
     30         * Fired when the template loader determines a robots.txt request.
     31         *
     32         * @since 2.1.0
     33         */
     34        do_action( 'do_robots' );
    1635        return;
    1736elseif ( is_feed() ) :
    1837        do_feed();
     
    4463        else :
    4564                $template = get_index_template();
    4665        endif;
     66        /**
     67         * Filter the path of the current template before including it.
     68         *
     69         * @since 3.0.0
     70         *
     71         * @param string $template The path of the template to include.
     72         */
    4773        if ( $template = apply_filters( 'template_include', $template ) )
    4874                include( $template );
    4975        return;