WordPress.org

Make WordPress Core

Changeset 38755


Ignore:
Timestamp:
10/07/16 21:02:39 (6 months ago)
Author:
johnbillion
Message:

Themes: Remove paged.php from the theme template hierarchy.

The position of this template within the hierarchy is of so little use that zero themes in the WordPress.org theme directory make use of it. It's second only to index.php in the hierarchy, meaning that any archive template such as category.php or archive.php will be chosen before it.

Fixes #38162
Props ryankienstra for initial patch

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r38641 r38755  
    37593759    return ''; 
    37603760} 
     3761 
     3762/** 
     3763 * Retrieve path of paged template in current or parent template. 
     3764 * 
     3765 * @since 1.5.0 
     3766 * @deprecated 4.7.0 The paged.php template is no longer part of the theme template heirarchy. 
     3767 * 
     3768 * @return string Full path to paged template file. 
     3769 */ 
     3770function get_paged_template() { 
     3771    _deprecated_function( __FUNCTION__, '4.7.0' ); 
     3772 
     3773    return get_query_template( 'paged' ); 
     3774} 
  • trunk/src/wp-includes/template-loader.php

    r37518 r38755  
    6161    elseif ( is_date()           && $template = get_date_template()           ) : 
    6262    elseif ( is_archive()        && $template = get_archive_template()        ) : 
    63     elseif ( is_paged()          && $template = get_paged_template()          ) : 
    6463    else : 
    6564        $template = get_index_template(); 
  • trunk/src/wp-includes/template.php

    r38609 r38755  
    380380 
    381381    return get_query_template( 'page', $templates ); 
    382 } 
    383  
    384 /** 
    385  * Retrieve path of paged template in current or parent template. 
    386  * 
    387  * The template hierarchy is filterable via the {@see 'paged_template_hierarchy'} hook. 
    388  * The template path is filterable via the {@see 'paged_template'} hook. 
    389  * 
    390  * @since 1.5.0 
    391  * 
    392  * @see get_query_template() 
    393  * 
    394  * @return string Full path to paged template file. 
    395  */ 
    396 function get_paged_template() { 
    397     return get_query_template('paged'); 
    398382} 
    399383 
  • trunk/tests/phpunit/tests/theme.php

    r35849 r38755  
    268268                $this->assertEquals(get_home_template(), get_query_template('home', array('home.php','index.php'))); 
    269269                $this->assertEquals(get_page_template(), get_query_template('page')); 
    270                 $this->assertEquals(get_paged_template(), get_query_template('paged')); 
    271270                $this->assertEquals(get_search_template(), get_query_template('search')); 
    272271                $this->assertEquals(get_single_template(), get_query_template('single')); 
Note: See TracChangeset for help on using the changeset viewer.