WordPress.org

Make WordPress Core

Ticket #18803: 18803.diff

File 18803.diff, 892 bytes (added by sivel, 7 years ago)
  • wp-includes/theme.php

     
    11071107function load_template( $_template_file, $require_once = true ) {
    11081108        global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
    11091109
     1110        $pre = apply_filters( 'pre_load_template', false, $_template_file, $require_once );
     1111        if ( $pre !== false )
     1112                return $pre;
     1113
    11101114        if ( is_array( $wp_query->query_vars ) )
    11111115                extract( $wp_query->query_vars, EXTR_SKIP );
    11121116
     1117        do_action('load_template_pre_require', $_template_file, $require_once);
    11131118        if ( $require_once )
    11141119                require_once( $_template_file );
    11151120        else
    11161121                require( $_template_file );
     1122        do_action('load_template_post_require', $_template_file, $require_once);
    11171123}
    11181124
    11191125/**