Replaces all uses of TEMPLATEPATH and STYLESHEETPATH in core with get_template_directory() and get_stylesheet_directory().

Add `@deprecated` annotations to `TEMPLATEPATH` and `STYLESHEETPATH` definitions.

Props obenland, aaroncampbell. 
Fixes #18298.


git-svn-id: https://develop.svn.wordpress.org/trunk@28563 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-05-23 20:11:08 +00:00
parent e2a124a911
commit 70f735669a
5 changed files with 20 additions and 14 deletions
+4 -4
View File
@@ -1049,7 +1049,7 @@ function wp_comment_form_unfiltered_html_nonce() {
* and the post ID respectively.
*
* The $file path is passed through a filter hook called, 'comments_template'
* which includes the TEMPLATEPATH and $file combined. Tries the $filtered path
* which includes the template path and $file combined. Tries the $filtered path
* first and if it fails it will require the default comment template from the
* default theme. If either does not exist, then the WordPress process will be
* halted. It is advised for that reason, that the default theme is not deleted.
@@ -1134,7 +1134,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false
if ( !defined('COMMENTS_TEMPLATE') )
define('COMMENTS_TEMPLATE', true);
$theme_template = STYLESHEETPATH . $file;
$theme_template = get_stylesheet_directory() . $file;
/**
* Filter the path to the theme template file used for the comments template.
*
@@ -1145,8 +1145,8 @@ function comments_template( $file = '/comments.php', $separate_comments = false
$include = apply_filters( 'comments_template', $theme_template );
if ( file_exists( $include ) )
require( $include );
elseif ( file_exists( TEMPLATEPATH . $file ) )
require( TEMPLATEPATH . $file );
elseif ( file_exists( get_template_directory() . $file ) )
require( get_template_directory() . $file );
else // Backward compat code will be removed in a future release
require( ABSPATH . WPINC . '/theme-compat/comments.php');
}