Introduce get_index_template(). Allows child themes to override a parent theme's index.php. Props koopersmith, fixes #12635
git-svn-id: http://svn.automattic.com/wordpress/trunk@13819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8babcc5d7c
commit
1eabd22805
|
@ -35,8 +35,8 @@ if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) :
|
||||||
elseif ( is_archive() && $template = get_archive_template() ) :
|
elseif ( is_archive() && $template = get_archive_template() ) :
|
||||||
elseif ( is_comments_popup() && $template = get_comments_popup_template() ) :
|
elseif ( is_comments_popup() && $template = get_comments_popup_template() ) :
|
||||||
elseif ( is_paged() && $template = get_paged_template() ) :
|
elseif ( is_paged() && $template = get_paged_template() ) :
|
||||||
elseif ( file_exists( TEMPLATEPATH . '/index.php' ) ) :
|
else :
|
||||||
$template = TEMPLATEPATH . '/index.php';
|
$template = get_index_template();
|
||||||
endif;
|
endif;
|
||||||
if ( $template = apply_filters( 'template_include', $template ) )
|
if ( $template = apply_filters( 'template_include', $template ) )
|
||||||
include( $template );
|
include( $template );
|
||||||
|
|
|
@ -685,6 +685,17 @@ function get_query_template($type) {
|
||||||
return apply_filters("{$type}_template", locate_template(array("{$type}.php")));
|
return apply_filters("{$type}_template", locate_template(array("{$type}.php")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve path of index template in current or parent template.
|
||||||
|
*
|
||||||
|
* @since 3.0.0
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function get_index_template() {
|
||||||
|
return get_query_template('index');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve path of 404 template in current or parent template.
|
* Retrieve path of 404 template in current or parent template.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue