<!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" />
<title>[20002] trunk: Move the template loading functions from wp-includes/theme.php to wp-includes/template.php.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/20002">20002</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-02-28 01:49:49 +0000 (Tue, 28 Feb 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the template loading functions from wp-includes/theme.php to wp-includes/template.php. This includes get_query_template(), locate_template(), and friends. see <a href="http://core.trac.wordpress.org/ticket/20103">#20103</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
<li><a href="#trunkwpsettingsphp">trunk/wp-settings.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludestemplatephp">trunk/wp-includes/template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludestemplatephpfromrev20001trunkwpincludesthemephp"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/template.php (from rev 20001, trunk/wp-includes/theme.php) (0 => 20002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/template.php                                (rev 0)
+++ trunk/wp-includes/template.php        2012-02-28 01:49:49 UTC (rev 20002)
</span><span class="lines">@@ -0,0 +1,397 @@
</span><ins>+&lt;?php
+/**
+ * Template loading functions.
+ *
+ * @package WordPress
+ * @subpackage Template
+ */
+
+/**
+ * Retrieve path to a template
+ *
+ * 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
+ * without the use of the other get_*_template() functions.
+ *
+ * @since 1.5.0
+ *
+ * @param string $type Filename without extension.
+ * @param array $templates An optional list of template candidates
+ * @return string Full path to file.
+ */
+function get_query_template( $type, $templates = array() ) {
+        $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
+
+        if ( empty( $templates ) )
+                $templates = array(&quot;{$type}.php&quot;);
+
+        return apply_filters( &quot;{$type}_template&quot;, locate_template( $templates ) );
+}
+
+/**
+ * Retrieve path of index template in current or parent template.
+ *
+ * @since 3.0.0
+ *
+ * @return string
+ */
+function get_index_template() {
+        return get_query_template('index');
+}
+
+/**
+ * Retrieve path of 404 template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_404_template() {
+        return get_query_template('404');
+}
+
+/**
+ * Retrieve path of archive template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_archive_template() {
+        $post_type = get_query_var( 'post_type' );
+
+        $templates = array();
+
+        if ( $post_type )
+                $templates[] = &quot;archive-{$post_type}.php&quot;;
+        $templates[] = 'archive.php';
+
+        return get_query_template( 'archive', $templates );
+}
+
+/**
+ * Retrieve path of author template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_author_template() {
+        $author = get_queried_object();
+
+        $templates = array();
+
+        $templates[] = &quot;author-{$author-&gt;user_nicename}.php&quot;;
+        $templates[] = &quot;author-{$author-&gt;ID}.php&quot;;
+        $templates[] = 'author.php';
+
+        return get_query_template( 'author', $templates );
+}
+
+/**
+ * Retrieve path of category template in current or parent template.
+ *
+ * Works by first retrieving the current slug for example 'category-default.php' and then
+ * trying category ID, for example 'category-1.php' and will finally fallback to category.php
+ * template, if those files don't exist.
+ *
+ * @since 1.5.0
+ * @uses apply_filters() Calls 'category_template' on file path of category template.
+ *
+ * @return string
+ */
+function get_category_template() {
+        $category = get_queried_object();
+
+        $templates = array();
+
+        $templates[] = &quot;category-{$category-&gt;slug}.php&quot;;
+        $templates[] = &quot;category-{$category-&gt;term_id}.php&quot;;
+        $templates[] = 'category.php';
+
+        return get_query_template( 'category', $templates );
+}
+
+/**
+ * Retrieve path of tag template in current or parent template.
+ *
+ * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then
+ * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php
+ * template, if those files don't exist.
+ *
+ * @since 2.3.0
+ * @uses apply_filters() Calls 'tag_template' on file path of tag template.
+ *
+ * @return string
+ */
+function get_tag_template() {
+        $tag = get_queried_object();
+
+        $templates = array();
+
+        $templates[] = &quot;tag-{$tag-&gt;slug}.php&quot;;
+        $templates[] = &quot;tag-{$tag-&gt;term_id}.php&quot;;
+        $templates[] = 'tag.php';
+
+        return get_query_template( 'tag', $templates );
+}
+
+/**
+ * Retrieve path of taxonomy template in current or parent template.
+ *
+ * Retrieves the taxonomy and term, if term is available. The template is
+ * prepended with 'taxonomy-' and followed by both the taxonomy string and
+ * the taxonomy string followed by a dash and then followed by the term.
+ *
+ * The taxonomy and term template is checked and used first, if it exists.
+ * Second, just the taxonomy template is checked, and then finally, taxonomy.php
+ * template is used. If none of the files exist, then it will fall back on to
+ * index.php.
+ *
+ * @since 2.5.0
+ * @uses apply_filters() Calls 'taxonomy_template' filter on found path.
+ *
+ * @return string
+ */
+function get_taxonomy_template() {
+        $term = get_queried_object();
+        $taxonomy = $term-&gt;taxonomy;
+
+        $templates = array();
+
+        $templates[] = &quot;taxonomy-$taxonomy-{$term-&gt;slug}.php&quot;;
+        $templates[] = &quot;taxonomy-$taxonomy.php&quot;;
+        $templates[] = 'taxonomy.php';
+
+        return get_query_template( 'taxonomy', $templates );
+}
+
+/**
+ * Retrieve path of date template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_date_template() {
+        return get_query_template('date');
+}
+
+/**
+ * Retrieve path of home template in current or parent template.
+ *
+ * This is the template used for the page containing the blog posts
+ *
+ * Attempts to locate 'home.php' first before falling back to 'index.php'.
+ *
+ * @since 1.5.0
+ * @uses apply_filters() Calls 'home_template' on file path of home template.
+ *
+ * @return string
+ */
+function get_home_template() {
+        $templates = array( 'home.php', 'index.php' );
+
+        return get_query_template( 'home', $templates );
+}
+
+/**
+ * Retrieve path of front-page template in current or parent template.
+ *
+ * Looks for 'front-page.php'.
+ *
+ * @since 3.0.0
+ * @uses apply_filters() Calls 'front_page_template' on file path of template.
+ *
+ * @return string
+ */
+function get_front_page_template() {
+        $templates = array('front-page.php');
+
+        return get_query_template( 'front_page', $templates );
+}
+
+/**
+ * Retrieve path of page template in current or parent template.
+ *
+ * Will first look for the specifically assigned page template
+ * The will search for 'page-{slug}.php' followed by 'page-id.php'
+ * and finally 'page.php'
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_page_template() {
+        $id = get_queried_object_id();
+        $template = get_post_meta($id, '_wp_page_template', true);
+        $pagename = get_query_var('pagename');
+
+        if ( !$pagename &amp;&amp; $id &gt; 0 ) {
+                // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
+                $post = get_queried_object();
+                $pagename = $post-&gt;post_name;
+        }
+
+        if ( 'default' == $template )
+                $template = '';
+
+        $templates = array();
+        if ( !empty($template) &amp;&amp; !validate_file($template) )
+                $templates[] = $template;
+        if ( $pagename )
+                $templates[] = &quot;page-$pagename.php&quot;;
+        if ( $id )
+                $templates[] = &quot;page-$id.php&quot;;
+        $templates[] = 'page.php';
+
+        return get_query_template( 'page', $templates );
+}
+
+/**
+ * Retrieve path of paged template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_paged_template() {
+        return get_query_template('paged');
+}
+
+/**
+ * Retrieve path of search template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_search_template() {
+        return get_query_template('search');
+}
+
+/**
+ * Retrieve path of single template in current or parent template.
+ *
+ * @since 1.5.0
+ *
+ * @return string
+ */
+function get_single_template() {
+        $object = get_queried_object();
+
+        $templates = array();
+
+        $templates[] = &quot;single-{$object-&gt;post_type}.php&quot;;
+        $templates[] = &quot;single.php&quot;;
+
+        return get_query_template( 'single', $templates );
+}
+
+/**
+ * Retrieve path of attachment template in current or parent template.
+ *
+ * The attachment path first checks if the first part of the mime type exists.
+ * The second check is for the second part of the mime type. The last check is
+ * for both types separated by an underscore. If neither are found then the file
+ * 'attachment.php' is checked and returned.
+ *
+ * Some examples for the 'text/plain' mime type are 'text.php', 'plain.php', and
+ * finally 'text_plain.php'.
+ *
+ * @since 2.0.0
+ *
+ * @return string
+ */
+function get_attachment_template() {
+        global $posts;
+        $type = explode('/', $posts[0]-&gt;post_mime_type);
+        if ( $template = get_query_template($type[0]) )
+                return $template;
+        elseif ( $template = get_query_template($type[1]) )
+                return $template;
+        elseif ( $template = get_query_template(&quot;$type[0]_$type[1]&quot;) )
+                return $template;
+        else
+                return get_query_template('attachment');
+}
+
+/**
+ * Retrieve path of comment popup template in current or parent template.
+ *
+ * Checks for comment popup template in current template, if it exists or in the
+ * parent template.
+ *
+ * @since 1.5.0
+ * @uses apply_filters() Calls 'comments_popup_template' filter on path.
+ *
+ * @return string
+ */
+function get_comments_popup_template() {
+        $template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );
+
+        // Backward compat code will be removed in a future release
+        if ('' == $template)
+                $template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';
+
+        return $template;
+}
+
+/**
+ * Retrieve the name of the highest priority template file that exists.
+ *
+ * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
+ * inherit from a parent theme can just overload one file.
+ *
+ * @since 2.7.0
+ *
+ * @param string|array $template_names Template file(s) to search for, in order.
+ * @param bool $load If true the template file will be loaded if it is found.
+ * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
+ * @return string The template filename if one is located.
+ */
+function locate_template($template_names, $load = false, $require_once = true ) {
+        $located = '';
+        foreach ( (array) $template_names as $template_name ) {
+                if ( !$template_name )
+                        continue;
+                if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
+                        $located = STYLESHEETPATH . '/' . $template_name;
+                        break;
+                } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
+                        $located = TEMPLATEPATH . '/' . $template_name;
+                        break;
+                }
+        }
+
+        if ( $load &amp;&amp; '' != $located )
+                load_template( $located, $require_once );
+
+        return $located;
+}
+
+/**
+ * Require the template file with WordPress environment.
+ *
+ * The globals are set up for the template file to ensure that the WordPress
+ * environment is available from within the function. The query variables are
+ * also available.
+ *
+ * @since 1.5.0
+ *
+ * @param string $_template_file Path to template file.
+ * @param bool $require_once Whether to require_once or require. Default true.
+ */
+function load_template( $_template_file, $require_once = true ) {
+        global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
+
+        if ( is_array( $wp_query-&gt;query_vars ) )
+                extract( $wp_query-&gt;query_vars, EXTR_SKIP );
+
+        if ( $require_once )
+                require_once( $_template_file );
+        else
+                require( $_template_file );
+}
+
</ins></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (20001 => 20002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2012-02-28 01:28:56 UTC (rev 20001)
+++ trunk/wp-includes/theme.php        2012-02-28 01:49:49 UTC (rev 20002)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  * Theme, template, and stylesheet functions.
</span><span class="cx">  *
</span><span class="cx">  * @package WordPress
</span><del>- * @subpackage Template
</del><ins>+ * @subpackage Theme
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -725,395 +725,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Retrieve path to a template
- *
- * 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
- * without the use of the other get_*_template() functions.
- *
- * @since 1.5.0
- *
- * @param string $type Filename without extension.
- * @param array $templates An optional list of template candidates
- * @return string Full path to file.
- */
-function get_query_template( $type, $templates = array() ) {
-        $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
-
-        if ( empty( $templates ) )
-                $templates = array(&quot;{$type}.php&quot;);
-
-        return apply_filters( &quot;{$type}_template&quot;, locate_template( $templates ) );
-}
-
-/**
- * Retrieve path of index template in current or parent template.
- *
- * @since 3.0.0
- *
- * @return string
- */
-function get_index_template() {
-        return get_query_template('index');
-}
-
-/**
- * Retrieve path of 404 template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_404_template() {
-        return get_query_template('404');
-}
-
-/**
- * Retrieve path of archive template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_archive_template() {
-        $post_type = get_query_var( 'post_type' );
-
-        $templates = array();
-
-        if ( $post_type )
-                $templates[] = &quot;archive-{$post_type}.php&quot;;
-        $templates[] = 'archive.php';
-
-        return get_query_template( 'archive', $templates );
-}
-
-/**
- * Retrieve path of author template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_author_template() {
-        $author = get_queried_object();
-
-        $templates = array();
-
-        $templates[] = &quot;author-{$author-&gt;user_nicename}.php&quot;;
-        $templates[] = &quot;author-{$author-&gt;ID}.php&quot;;
-        $templates[] = 'author.php';
-
-        return get_query_template( 'author', $templates );
-}
-
-/**
- * Retrieve path of category template in current or parent template.
- *
- * Works by first retrieving the current slug for example 'category-default.php' and then
- * trying category ID, for example 'category-1.php' and will finally fallback to category.php
- * template, if those files don't exist.
- *
- * @since 1.5.0
- * @uses apply_filters() Calls 'category_template' on file path of category template.
- *
- * @return string
- */
-function get_category_template() {
-        $category = get_queried_object();
-
-        $templates = array();
-
-        $templates[] = &quot;category-{$category-&gt;slug}.php&quot;;
-        $templates[] = &quot;category-{$category-&gt;term_id}.php&quot;;
-        $templates[] = 'category.php';
-
-        return get_query_template( 'category', $templates );
-}
-
-/**
- * Retrieve path of tag template in current or parent template.
- *
- * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then
- * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php
- * template, if those files don't exist.
- *
- * @since 2.3.0
- * @uses apply_filters() Calls 'tag_template' on file path of tag template.
- *
- * @return string
- */
-function get_tag_template() {
-        $tag = get_queried_object();
-
-        $templates = array();
-
-        $templates[] = &quot;tag-{$tag-&gt;slug}.php&quot;;
-        $templates[] = &quot;tag-{$tag-&gt;term_id}.php&quot;;
-        $templates[] = 'tag.php';
-
-        return get_query_template( 'tag', $templates );
-}
-
-/**
- * Retrieve path of taxonomy template in current or parent template.
- *
- * Retrieves the taxonomy and term, if term is available. The template is
- * prepended with 'taxonomy-' and followed by both the taxonomy string and
- * the taxonomy string followed by a dash and then followed by the term.
- *
- * The taxonomy and term template is checked and used first, if it exists.
- * Second, just the taxonomy template is checked, and then finally, taxonomy.php
- * template is used. If none of the files exist, then it will fall back on to
- * index.php.
- *
- * @since 2.5.0
- * @uses apply_filters() Calls 'taxonomy_template' filter on found path.
- *
- * @return string
- */
-function get_taxonomy_template() {
-        $term = get_queried_object();
-        $taxonomy = $term-&gt;taxonomy;
-
-        $templates = array();
-
-        $templates[] = &quot;taxonomy-$taxonomy-{$term-&gt;slug}.php&quot;;
-        $templates[] = &quot;taxonomy-$taxonomy.php&quot;;
-        $templates[] = 'taxonomy.php';
-
-        return get_query_template( 'taxonomy', $templates );
-}
-
-/**
- * Retrieve path of date template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_date_template() {
-        return get_query_template('date');
-}
-
-/**
- * Retrieve path of home template in current or parent template.
- *
- * This is the template used for the page containing the blog posts
- *
- * Attempts to locate 'home.php' first before falling back to 'index.php'.
- *
- * @since 1.5.0
- * @uses apply_filters() Calls 'home_template' on file path of home template.
- *
- * @return string
- */
-function get_home_template() {
-        $templates = array( 'home.php', 'index.php' );
-
-        return get_query_template( 'home', $templates );
-}
-
-/**
- * Retrieve path of front-page template in current or parent template.
- *
- * Looks for 'front-page.php'.
- *
- * @since 3.0.0
- * @uses apply_filters() Calls 'front_page_template' on file path of template.
- *
- * @return string
- */
-function get_front_page_template() {
-        $templates = array('front-page.php');
-
-        return get_query_template( 'front_page', $templates );
-}
-
-/**
- * Retrieve path of page template in current or parent template.
- *
- * Will first look for the specifically assigned page template
- * The will search for 'page-{slug}.php' followed by 'page-id.php'
- * and finally 'page.php'
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_page_template() {
-        $id = get_queried_object_id();
-        $template = get_post_meta($id, '_wp_page_template', true);
-        $pagename = get_query_var('pagename');
-
-        if ( !$pagename &amp;&amp; $id &gt; 0 ) {
-                // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
-                $post = get_queried_object();
-                $pagename = $post-&gt;post_name;
-        }
-
-        if ( 'default' == $template )
-                $template = '';
-
-        $templates = array();
-        if ( !empty($template) &amp;&amp; !validate_file($template) )
-                $templates[] = $template;
-        if ( $pagename )
-                $templates[] = &quot;page-$pagename.php&quot;;
-        if ( $id )
-                $templates[] = &quot;page-$id.php&quot;;
-        $templates[] = 'page.php';
-
-        return get_query_template( 'page', $templates );
-}
-
-/**
- * Retrieve path of paged template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_paged_template() {
-        return get_query_template('paged');
-}
-
-/**
- * Retrieve path of search template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_search_template() {
-        return get_query_template('search');
-}
-
-/**
- * Retrieve path of single template in current or parent template.
- *
- * @since 1.5.0
- *
- * @return string
- */
-function get_single_template() {
-        $object = get_queried_object();
-
-        $templates = array();
-
-        $templates[] = &quot;single-{$object-&gt;post_type}.php&quot;;
-        $templates[] = &quot;single.php&quot;;
-
-        return get_query_template( 'single', $templates );
-}
-
-/**
- * Retrieve path of attachment template in current or parent template.
- *
- * The attachment path first checks if the first part of the mime type exists.
- * The second check is for the second part of the mime type. The last check is
- * for both types separated by an underscore. If neither are found then the file
- * 'attachment.php' is checked and returned.
- *
- * Some examples for the 'text/plain' mime type are 'text.php', 'plain.php', and
- * finally 'text_plain.php'.
- *
- * @since 2.0.0
- *
- * @return string
- */
-function get_attachment_template() {
-        global $posts;
-        $type = explode('/', $posts[0]-&gt;post_mime_type);
-        if ( $template = get_query_template($type[0]) )
-                return $template;
-        elseif ( $template = get_query_template($type[1]) )
-                return $template;
-        elseif ( $template = get_query_template(&quot;$type[0]_$type[1]&quot;) )
-                return $template;
-        else
-                return get_query_template('attachment');
-}
-
-/**
- * Retrieve path of comment popup template in current or parent template.
- *
- * Checks for comment popup template in current template, if it exists or in the
- * parent template.
- *
- * @since 1.5.0
- * @uses apply_filters() Calls 'comments_popup_template' filter on path.
- *
- * @return string
- */
-function get_comments_popup_template() {
-        $template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );
-
-        // Backward compat code will be removed in a future release
-        if ('' == $template)
-                $template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';
-
-        return $template;
-}
-
-/**
- * Retrieve the name of the highest priority template file that exists.
- *
- * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
- * inherit from a parent theme can just overload one file.
- *
- * @since 2.7.0
- *
- * @param string|array $template_names Template file(s) to search for, in order.
- * @param bool $load If true the template file will be loaded if it is found.
- * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
- * @return string The template filename if one is located.
- */
-function locate_template($template_names, $load = false, $require_once = true ) {
-        $located = '';
-        foreach ( (array) $template_names as $template_name ) {
-                if ( !$template_name )
-                        continue;
-                if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
-                        $located = STYLESHEETPATH . '/' . $template_name;
-                        break;
-                } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
-                        $located = TEMPLATEPATH . '/' . $template_name;
-                        break;
-                }
-        }
-
-        if ( $load &amp;&amp; '' != $located )
-                load_template( $located, $require_once );
-
-        return $located;
-}
-
-/**
- * Require the template file with WordPress environment.
- *
- * The globals are set up for the template file to ensure that the WordPress
- * environment is available from within the function. The query variables are
- * also available.
- *
- * @since 1.5.0
- *
- * @param string $_template_file Path to template file.
- * @param bool $require_once Whether to require_once or require. Default true.
- */
-function load_template( $_template_file, $require_once = true ) {
-        global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
-
-        if ( is_array( $wp_query-&gt;query_vars ) )
-                extract( $wp_query-&gt;query_vars, EXTR_SKIP );
-
-        if ( $require_once )
-                require_once( $_template_file );
-        else
-                require( $_template_file );
-}
-
-/**
</del><span class="cx">  * Display localized stylesheet link element.
</span><span class="cx">  *
</span><span class="cx">  * @since 2.1.0
</span></span></pre></div>
<a id="trunkwpsettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-settings.php (20001 => 20002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-settings.php        2012-02-28 01:28:56 UTC (rev 20001)
+++ trunk/wp-settings.php        2012-02-28 01:49:49 UTC (rev 20002)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx"> require( ABSPATH . WPINC . '/capabilities.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/query.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/theme.php' );
</span><ins>+require( ABSPATH . WPINC . '/template.php' );
</ins><span class="cx"> require( ABSPATH . WPINC . '/user.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/meta.php' );
</span><span class="cx"> require( ABSPATH . WPINC . '/general-template.php' );
</span></span></pre>
</div>
</div>

</body>
</html>