WordPress.org

Make WordPress Core

Changeset 45231


Ignore:
Timestamp:
04/17/2019 12:57:01 PM (5 weeks ago)
Author:
SergeyBiryukov
Message:

Themes: Standardize on passing frontpage and privacypolicy as the $type parameter to get_query_template().

These keys are used in {$type}_template_hierarchy and {$type}_template filters.

Previously, front_page and privacy_policy were passed, but get_query_template() stripped the underscores before passing the values to the filters.

Props rinatkhaziev, tmatsuur, johnbillion.
Fixes #21213, #46958.

File:
1 edited

Legend:

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

    r44966 r45231  
    5858     *
    5959     * @param string $template  Path to the template. See locate_template().
    60      * @param string $type      Filename without extension.
     60     * @param string $type      Sanitized filename without extension.
    6161     * @param array  $templates A list of template candidates, in descending order of priority.
    6262     */
     
    374374    $templates = array( 'front-page.php' );
    375375
    376     return get_query_template( 'front_page', $templates );
     376    return get_query_template( 'frontpage', $templates );
    377377}
    378378
     
    392392    $templates = array( 'privacy-policy.php' );
    393393
    394     return get_query_template( 'privacy_policy', $templates );
     394    return get_query_template( 'privacypolicy', $templates );
    395395}
    396396
Note: See TracChangeset for help on using the changeset viewer.