WordPress.org

Make WordPress Core

Ticket #21062: add-template-file-hook.diff

File add-template-file-hook.diff, 457 bytes (added by mikeschinkel, 6 years ago)

Patch to add a 'template_file' hook to load_template()

  • wp-includes/template.php

     
    386386        if ( is_array( $wp_query->query_vars ) )
    387387                extract( $wp_query->query_vars, EXTR_SKIP );
    388388
     389        $_template_file = apply_filters( 'template_file', $_template_file, $require_once );
     390
    389391        if ( $require_once )
    390392                require_once( $_template_file );
    391393        else