WordPress.org

Make WordPress Core

Changeset 32846


Ignore:
Timestamp:
06/18/2015 07:00:09 PM (3 years ago)
Author:
jorbin
Message:

Add singular.php to template hierarchy

Singular is the only template context conditional that lacks a corresponding template. This allows some themes to simplify.

Fixes #22314.
Props chipbennett.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r25991 r32846  
    5454    elseif ( is_single()         && $template = get_single_template()         ) :
    5555    elseif ( is_page()           && $template = get_page_template()           ) :
     56    elseif ( is_singular()       && $template = get_singular_template()       ) :
    5657    elseif ( is_category()       && $template = get_category_template()       ) :
    5758    elseif ( is_tag()            && $template = get_tag_template()            ) :
  • trunk/src/wp-includes/template.php

    r32804 r32846  
    384384
    385385/**
     386 * Retrieve path of singular template in current or parent template.
     387 *
     388 * The template path is filterable via the 'singular_template' hook.
     389 *
     390 * @since 4.3.0
     391 *
     392 * @see get_query_template()
     393 *
     394 * @return string Full path to singular template file
     395 */
     396function get_singular_template() {
     397    return get_query_template( 'singular' );
     398}
     399
     400/**
    386401 * Retrieve path of attachment template in current or parent template.
    387402 *
Note: See TracChangeset for help on using the changeset viewer.