<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[17214] trunk/wp-includes/theme.php: Revert [15611] for 3.1.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17214">17214</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2011-01-04 07:23:41 +0000 (Tue, 04 Jan 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Revert <a href="http://trac.wordpress.org/changeset/15611">[15611]</a> for 3.1. Needs more time for peer review and iteration. see <a href="http://trac.wordpress.org/ticket/14310">#14310</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (17213 => 17214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2011-01-03 23:56:42 UTC (rev 17213)
+++ trunk/wp-includes/theme.php        2011-01-04 07:23:41 UTC (rev 17214)
</span><span class="lines">@@ -728,26 +728,30 @@
</span><span class="cx"> /**
</span><span class="cx"> * Retrieve path to a template
</span><span class="cx"> *
</span><del>- * Used to quickly retrieve the path of a template without including the file
- * extension. It will also check the parent theme, if the file exists, with
- * the use of {@link locate_template()}. Allows for more generic template location
</del><ins>+ * Used to quickly retrieve the path of file without including the file
+ * extension. It will also check the parent template, if the file exists, with
+ * the use of {@link locate_template()}. Allows for more generic file location
</ins><span class="cx"> * without the use of the other get_*_template() functions.
</span><span class="cx"> *
</span><ins>+ * Can be used with include() or require() to retrieve path.
+ * <code>
+ * if( '' != get_query_template( '404' ) )
+ * include( get_query_template( '404' ) );
+ * </code>
+ * or the same can be accomplished with
+ * <code>
+ * if( '' != get_404_template() )
+ * include( get_404_template() );
+ * </code>
+ *
</ins><span class="cx"> * @since 1.5.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $type Filename without extension.
</span><del>- * @param array $templates An optional list of template candidates
</del><span class="cx"> * @return string Full path to file.
</span><span class="cx"> */
</span><del>-function get_query_template( $type, $templates = array() ) {
</del><ins>+function get_query_template($type) {
</ins><span class="cx">         $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
</span><del>-
-        if ( empty( $templates ) )
-                $templates = array("{$type}.php");
-
-        $templates = apply_filters( "{$type}_template_hierarchy", $templates );
-
-        return apply_filters( "{$type}_template", locate_template( $templates ) );
</del><ins>+        return apply_filters("{$type}_template", locate_template(array("{$type}.php")));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -807,7 +811,8 @@
</span><span class="cx">         $templates[] = "author-{$author->ID}.php";
</span><span class="cx">         $templates[] = 'author.php';
</span><span class="cx">
</span><del>-        return get_query_template( 'author', $templates );
</del><ins>+        $template = locate_template( $templates );
+        return apply_filters( 'author_template', $template );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -831,7 +836,8 @@
</span><span class="cx">         $templates[] = "category-{$category->term_id}.php";
</span><span class="cx">         $templates[] = "category.php";
</span><span class="cx">
</span><del>-        return get_query_template( 'category', $templates );
</del><ins>+        $template = locate_template($templates);
+        return apply_filters('category_template', $template);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -855,7 +861,8 @@
</span><span class="cx">         $templates[] = "tag-{$tag->term_id}.php";
</span><span class="cx">         $templates[] = "tag.php";
</span><span class="cx">
</span><del>-        return get_query_template( 'tag', $templates );
</del><ins>+        $template = locate_template($templates);
+        return apply_filters('tag_template', $template);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -885,7 +892,8 @@
</span><span class="cx">         $templates[] = "taxonomy-$taxonomy.php";
</span><span class="cx">         $templates[] = "taxonomy.php";
</span><span class="cx">
</span><del>-        return get_query_template( 'taxonomy', $templates );
</del><ins>+        $template = locate_template($templates);
+        return apply_filters('taxonomy_template', $template);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -912,9 +920,8 @@
</span><span class="cx"> * @return string
</span><span class="cx"> */
</span><span class="cx"> function get_home_template() {
</span><del>-        $templates = array( 'home.php', 'index.php' );
-
-        return get_query_template( 'home', $templates );
</del><ins>+        $template = locate_template(array('home.php', 'index.php'));
+        return apply_filters('home_template', $template);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -928,9 +935,7 @@
</span><span class="cx"> * @return string
</span><span class="cx"> */
</span><span class="cx"> function get_front_page_template() {
</span><del>-        $templates = array('front-page.php');
-
-        return get_query_template( 'front_page', $templates );
</del><ins>+        return apply_filters( 'front_page_template', locate_template( array('front-page.php') ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -967,7 +972,7 @@
</span><span class="cx">                 $templates[] = "page-$id.php";
</span><span class="cx">         $templates[] = "page.php";
</span><span class="cx">
</span><del>-        return get_query_template( 'page', $templates );
</del><ins>+        return apply_filters('page_template', locate_template($templates));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -1050,13 +1055,13 @@
</span><span class="cx"> * @return string
</span><span class="cx"> */
</span><span class="cx"> function get_comments_popup_template() {
</span><del>-        $template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );
</del><ins>+        $template = locate_template(array("comments-popup.php"));
</ins><span class="cx">
</span><span class="cx">         // Backward compat code will be removed in a future release
</span><span class="cx">         if ('' == $template)
</span><span class="cx">                 $template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';
</span><span class="cx">
</span><del>-        return $template;
</del><ins>+        return apply_filters('comments_popup_template', $template);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>
</body>
</html>