WordPress.org

Make WordPress Core

Changeset 13819


Ignore:
Timestamp:
03/26/2010 01:52:43 PM (8 years ago)
Author:
nacin
Message:

Introduce get_index_template(). Allows child themes to override a parent theme's index.php. Props koopersmith, fixes #12635

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-loader.php

    r13268 r13819  
    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 ) )
  • trunk/wp-includes/theme.php

    r13673 r13819  
    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 *
Note: See TracChangeset for help on using the changeset viewer.