Ticket #12371: generalize_template_logic.12371.diff
File generalize_template_logic.12371.diff, 4.2 KB (added by , 15 years ago) |
---|
-
wp-includes/general-template.php
94 94 } 95 95 96 96 /** 97 * Load a generic template.97 * Load a specific template. 98 98 * 99 99 * Includes the named template for a theme or if a name is specified then a 100 100 * specialised template will be included. If the theme contains no {slug}.php file … … 105 105 * 106 106 * @uses locate_template() 107 107 * @since 3.0.0 108 * @uses do_action() Calls 'get_ generic_template_{$slug}' action.108 * @uses do_action() Calls 'get_specific_template_{$slug}' action. 109 109 * 110 110 * @param string $slug The slug name for the generic template. 111 111 * @param string $name The name of the specialised template. 112 112 */ 113 function get_ generic_template( $slug, $name = null ) {114 do_action( "get_ generic_template_{$slug}", $name );113 function get_specific_template( $slug, $name = null ) { 114 do_action( "get_specific_template_{$slug}", $name ); 115 115 116 116 $templates = array(); 117 117 if ( isset($name) ) -
wp-content/themes/twentyten/author.php
21 21 22 22 <?php rewind_posts(); ?> 23 23 24 <?php get_ generic_template( 'loop', 'author' ); ?>24 <?php get_specific_template( 'loop', 'author' ); ?> 25 25 26 26 </div><!-- #content --> 27 27 </div><!-- #container --> -
wp-content/themes/twentyten/search.php
5 5 6 6 <?php if ( have_posts() ) : ?> 7 7 <h1 class="page-title"><?php _e( 'Search Results for: ', 'twentyten' ); ?><span><?php the_search_query(); ?></span></h1> 8 <?php get_ generic_template( 'loop', 'search' ); ?>8 <?php get_specific_template( 'loop', 'search' ); ?> 9 9 <?php else : ?> 10 10 <div id="post-0" class="post no-results not-found"> 11 11 <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2> -
wp-content/themes/twentyten/index.php
4 4 <div id="content"> 5 5 6 6 <?php if ( have_posts() ) : 7 get_ generic_template( 'loop', 'index' );7 get_specific_template( 'loop', 'index' ); 8 8 else : ?> 9 9 <h2><?php _e( 'Not Found', 'twentyten' ); ?></h2> 10 10 <div class="entry-content"> -
wp-content/themes/twentyten/tag.php
9 9 10 10 <?php rewind_posts(); ?> 11 11 12 <?php get_ generic_template( 'loop', 'tag' ); ?>12 <?php get_specific_template( 'loop', 'tag' ); ?> 13 13 14 14 </div><!-- #content --> 15 15 </div><!-- #container --> -
wp-content/themes/twentyten/category.php
6 6 <h1 class="page-title"><?php _e( 'Category Archives:', 'twentyten' ); ?> <span><?php single_cat_title(); ?></span></span></h1> 7 7 <?php $categorydesc = category_description(); if ( !empty($categorydesc) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $categorydesc . '</div>' ); ?> 8 8 9 <?php get_ generic_template( 'loop', 'category' ); ?>9 <?php get_specific_template( 'loop', 'category' ); ?> 10 10 11 11 </div><!-- #content --> 12 12 </div><!-- #container --> -
wp-content/themes/twentyten/archive.php
17 17 18 18 <?php rewind_posts(); ?> 19 19 20 <?php get_ generic_template( 'loop', 'archive' ); ?>20 <?php get_specific_template( 'loop', 'archive' ); ?> 21 21 22 22 </div><!-- #content --> 23 23 </div><!-- #container -->