WordPress.org

Make WordPress Core

Ticket #12371: generalize_template_logic.12371.diff

File generalize_template_logic.12371.diff, 4.2 KB (added by filosofo, 8 years ago)
  • wp-includes/general-template.php

     
    9494}
    9595
    9696/**
    97  * Load a generic template.
     97 * Load a specific template.
    9898 *
    9999 * Includes the named template for a theme or if a name is specified then a
    100100 * specialised template will be included. If the theme contains no {slug}.php file
     
    105105 *
    106106 * @uses locate_template()
    107107 * @since 3.0.0
    108  * @uses do_action() Calls 'get_generic_template_{$slug}' action.
     108 * @uses do_action() Calls 'get_specific_template_{$slug}' action.
    109109 *
    110110 * @param string $slug The slug name for the generic template.
    111111 * @param string $name The name of the specialised template.
    112112 */
    113 function get_generic_template( $slug, $name = null ) {
    114         do_action( "get_generic_template_{$slug}", $name );
     113function get_specific_template( $slug, $name = null ) {
     114        do_action( "get_specific_template_{$slug}", $name );
    115115
    116116        $templates = array();
    117117        if ( isset($name) )
  • wp-content/themes/twentyten/author.php

     
    2121
    2222<?php rewind_posts(); ?>
    2323
    24 <?php get_generic_template( 'loop', 'author' ); ?>
     24<?php get_specific_template( 'loop', 'author' ); ?>
    2525
    2626                        </div><!-- #content -->
    2727                </div><!-- #container -->
  • wp-content/themes/twentyten/search.php

     
    55
    66<?php if ( have_posts() ) : ?>
    77                                <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' ); ?>
    99<?php else : ?>
    1010                                <div id="post-0" class="post no-results not-found">
    1111                                        <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2>
  • wp-content/themes/twentyten/index.php

     
    44                        <div id="content">
    55
    66    <?php if ( have_posts() ) :
    7                 get_generic_template( 'loop', 'index' );
     7                get_specific_template( 'loop', 'index' );
    88    else : ?>
    99                <h2><?php _e( 'Not Found', 'twentyten' ); ?></h2>
    1010                <div class="entry-content">
  • wp-content/themes/twentyten/tag.php

     
    99
    1010<?php rewind_posts(); ?>
    1111
    12 <?php get_generic_template( 'loop', 'tag' ); ?>
     12<?php get_specific_template( 'loop', 'tag' ); ?>
    1313
    1414                        </div><!-- #content -->
    1515                </div><!-- #container -->
  • wp-content/themes/twentyten/category.php

     
    66                                <h1 class="page-title"><?php _e( 'Category Archives:', 'twentyten' ); ?> <span><?php single_cat_title(); ?></span></span></h1>
    77                                <?php $categorydesc = category_description(); if ( !empty($categorydesc) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $categorydesc . '</div>' ); ?>
    88
    9 <?php get_generic_template( 'loop', 'category' ); ?>
     9<?php get_specific_template( 'loop', 'category' ); ?>
    1010
    1111                        </div><!-- #content -->
    1212                </div><!-- #container -->
  • wp-content/themes/twentyten/archive.php

     
    1717
    1818<?php rewind_posts(); ?>
    1919
    20 <?php get_generic_template( 'loop', 'archive' ); ?>
     20<?php get_specific_template( 'loop', 'archive' ); ?>
    2121
    2222                        </div><!-- #content -->
    2323                </div><!-- #container -->