Ticket #18298: 18298.3.diff

File 18298.3.diff, 4.4 KB (added by aaroncampbell, 21 months ago)
Line 
1Index: wp-includes/default-constants.php
2===================================================================
3--- wp-includes/default-constants.php   (revision 18565)
4+++ wp-includes/default-constants.php   (working copy)
5@@ -279,12 +279,16 @@
6        /**
7         * Filesystem path to the current active template directory
8         * @since 1.5.0
9+        * @deprecated 3.3
10+        * @deprecated Use get_template_directory()
11         */
12        define('TEMPLATEPATH', get_template_directory());
13 
14        /**
15         * Filesystem path to the current active template stylesheet directory
16         * @since 2.1.0
17+        * @deprecated 3.3
18+        * @deprecated Use get_stylesheet_directory()
19         */
20        define('STYLESHEETPATH', get_stylesheet_directory());
21 
22Index: wp-includes/theme.php
23===================================================================
24--- wp-includes/theme.php       (revision 18565)
25+++ wp-includes/theme.php       (working copy)
26@@ -14,7 +14,7 @@
27  * @return bool true if a child theme is in use, false otherwise.
28  **/
29 function is_child_theme() {
30-       return ( TEMPLATEPATH !== STYLESHEETPATH );
31+       return ( get_template_directory() !== get_stylesheet_directory() );
32 }
33 
34 /**
35@@ -1062,7 +1062,7 @@
36 /**
37  * Retrieve the name of the highest priority template file that exists.
38  *
39- * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
40+ * Searches in the stylesheet path before template path so that themes which
41  * inherit from a parent theme can just overload one file.
42  *
43  * @since 2.7.0
44@@ -1077,11 +1077,11 @@
45        foreach ( (array) $template_names as $template_name ) {
46                if ( !$template_name )
47                        continue;
48-               if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
49-                       $located = STYLESHEETPATH . '/' . $template_name;
50+               if ( file_exists(get_stylesheet_directory() . '/' . $template_name)) {
51+                       $located = get_stylesheet_directory() . '/' . $template_name;
52                        break;
53-               } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
54-                       $located = TEMPLATEPATH . '/' . $template_name;
55+               } else if ( file_exists(get_template_directory() . '/' . $template_name) ) {
56+                       $located = get_template_directory() . '/' . $template_name;
57                        break;
58                }
59        }
60Index: wp-includes/comment-template.php
61===================================================================
62--- wp-includes/comment-template.php    (revision 18565)
63+++ wp-includes/comment-template.php    (working copy)
64@@ -831,7 +831,7 @@
65  * and the post ID respectively.
66  *
67  * The $file path is passed through a filter hook called, 'comments_template'
68- * which includes the TEMPLATEPATH and $file combined. Tries the $filtered path
69+ * which includes the template path and $file combined. Tries the $filtered path
70  * first and if it fails it will require the default comment themplate from the
71  * default theme. If either does not exist, then the WordPress process will be
72  * halted. It is advised for that reason, that the default theme is not deleted.
73@@ -908,11 +908,11 @@
74        if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE)
75                define('COMMENTS_TEMPLATE', true);
76 
77-       $include = apply_filters('comments_template', STYLESHEETPATH . $file );
78+       $include = apply_filters('comments_template', get_stylesheet_directory() . $file );
79        if ( file_exists( $include ) )
80                require( $include );
81-       elseif ( file_exists( TEMPLATEPATH . $file ) )
82-               require( TEMPLATEPATH .  $file );
83+       elseif ( file_exists( get_template_directory() . $file ) )
84+               require( get_template_directory() .  $file );
85        else // Backward compat code will be removed in a future release
86                require( ABSPATH . WPINC . '/theme-compat/comments.php');
87 }
88Index: wp-settings.php
89===================================================================
90--- wp-settings.php     (revision 18565)
91+++ wp-settings.php     (working copy)
92@@ -279,10 +279,10 @@
93 
94 // Load the functions for the active theme, for both parent and child theme if applicable.
95 if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
96-       if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
97-               include( STYLESHEETPATH . '/functions.php' );
98-       if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
99-               include( TEMPLATEPATH . '/functions.php' );
100+       if ( get_template_directory() !== get_stylesheet_directory() && file_exists( get_stylesheet_directory() . '/functions.php' ) )
101+               include( get_stylesheet_directory() . '/functions.php' );
102+       if ( file_exists( get_template_directory() . '/functions.php' ) )
103+               include( get_template_directory() . '/functions.php' );
104 }
105 
106 do_action( 'after_setup_theme' );