WordPress.org

Make WordPress Core

Ticket #12635: 12635.2.patch

File 12635.2.patch, 1.2 KB (added by koopersmith, 8 years ago)

Introduce get_index_template()

  • wp-includes/template-loader.php

     
    3535        elseif ( is_archive()        && $template = get_archive_template()        ) :
    3636        elseif ( is_comments_popup() && $template = get_comments_popup_template() ) :
    3737        elseif ( is_paged()          && $template = get_paged_template()          ) :
    38         elseif ( file_exists( TEMPLATEPATH . '/index.php' ) ) :
    39                 $template = TEMPLATEPATH . '/index.php';
     38        else :
     39                $template = get_index_template();
    4040        endif;
    4141        if ( $template = apply_filters( 'template_include', $template ) )
    4242                include( $template );
  • wp-includes/theme.php

     
    686686}
    687687
    688688/**
     689 * Retrieve path of index template in current or parent template.
     690 *
     691 * @since 3.0.0
     692 *
     693 * @return string
     694 */
     695function get_index_template() {
     696        return get_query_template('index');
     697}
     698
     699/**
    689700 * Retrieve path of 404 template in current or parent template.
    690701 *
    691702 * @since 1.5.0