From acf5ca35c8db1f39da540f94864bd5a25ef5c823 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 12 Feb 2017 21:24:16 +0000 Subject: [PATCH] Themes: Add template type and template candidates as parameters to the `{$type}_template` filter. Props mschadegg Fixes #39525 git-svn-id: https://develop.svn.wordpress.org/trunk@40057 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/template.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/template.php b/src/wp-includes/template.php index cc15eedb48..d449be4f53 100644 --- a/src/wp-includes/template.php +++ b/src/wp-includes/template.php @@ -53,10 +53,13 @@ function get_query_template( $type, $templates = array() ) { * 'embed', home', 'frontpage', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'. * * @since 1.5.0 + * @since 4.8.0 The `$type` and `$templates` parameters were added. * - * @param string $template Path to the template. See locate_template(). + * @param string $template Path to the template. See locate_template(). + * @param string $type Filename without extension. + * @param array $templates A list of template candidates, in descending order of priority. */ - return apply_filters( "{$type}_template", $template ); + return apply_filters( "{$type}_template", $template, $type, $templates ); } /**