Ticket #18298: 18298.4.diff
File 18298.4.diff, 4.7 KB (added by , 10 years ago) |
---|
-
src/wp-includes/comment-template.php
1052 1052 * and the post ID respectively. 1053 1053 * 1054 1054 * The $file path is passed through a filter hook called, 'comments_template' 1055 * which includes the TEMPLATEPATHand $file combined. Tries the $filtered path1055 * which includes the template path and $file combined. Tries the $filtered path 1056 1056 * first and if it fails it will require the default comment template from the 1057 1057 * default theme. If either does not exist, then the WordPress process will be 1058 1058 * halted. It is advised for that reason, that the default theme is not deleted. … … 1137 1137 if ( !defined('COMMENTS_TEMPLATE') ) 1138 1138 define('COMMENTS_TEMPLATE', true); 1139 1139 1140 $theme_template = STYLESHEETPATH. $file;1140 $theme_template = get_stylesheet_directory() . $file; 1141 1141 /** 1142 1142 * Filter the path to the theme template file used for the comments template. 1143 1143 * … … 1148 1148 $include = apply_filters( 'comments_template', $theme_template ); 1149 1149 if ( file_exists( $include ) ) 1150 1150 require( $include ); 1151 elseif ( file_exists( TEMPLATEPATH. $file ) )1152 require( TEMPLATEPATH. $file );1151 elseif ( file_exists( get_template_directory() . $file ) ) 1152 require( get_template_directory() . $file ); 1153 1153 else // Backward compat code will be removed in a future release 1154 1154 require( ABSPATH . WPINC . '/theme-compat/comments.php'); 1155 1155 } -
src/wp-includes/default-constants.php
296 296 /** 297 297 * Filesystem path to the current active template directory 298 298 * @since 1.5.0 299 * @deprecated 4.0 300 * @deprecated Use get_template_directory() 299 301 */ 300 302 define('TEMPLATEPATH', get_template_directory()); 301 303 302 304 /** 303 305 * Filesystem path to the current active template stylesheet directory 304 306 * @since 2.1.0 307 * @deprecated 4.0 308 * @deprecated Use get_stylesheet_directory() 305 309 */ 306 310 define('STYLESHEETPATH', get_stylesheet_directory()); 307 311 -
src/wp-includes/template.php
449 449 /** 450 450 * Retrieve the name of the highest priority template file that exists. 451 451 * 452 * Searches in the STYLESHEETPATH before TEMPLATEPATHso that themes which452 * Searches in the stylesheet path before template path so that themes which 453 453 * inherit from a parent theme can just overload one file. 454 454 * 455 455 * @since 2.7.0 … … 464 464 foreach ( (array) $template_names as $template_name ) { 465 465 if ( !$template_name ) 466 466 continue; 467 if ( file_exists( STYLESHEETPATH . '/' . $template_name)) {468 $located = STYLESHEETPATH. '/' . $template_name;467 if ( file_exists( get_stylesheet_directory() . '/' . $template_name ) ) { 468 $located = get_stylesheet_directory() . '/' . $template_name; 469 469 break; 470 } else if ( file_exists( TEMPLATEPATH . '/' . $template_name) ) {471 $located = TEMPLATEPATH. '/' . $template_name;470 } else if ( file_exists( get_template_directory() . '/' . $template_name ) ) { 471 $located = get_template_directory() . '/' . $template_name; 472 472 break; 473 473 } 474 474 } -
src/wp-includes/theme.php
128 128 * @return bool true if a child theme is in use, false otherwise. 129 129 **/ 130 130 function is_child_theme() { 131 return ( TEMPLATEPATH !== STYLESHEETPATH);131 return get_template_directory() !== get_stylesheet_directory(); 132 132 } 133 133 134 134 /** -
src/wp-settings.php
322 322 323 323 // Load the functions for the active theme, for both parent and child theme if applicable. 324 324 if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { 325 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) 326 include( STYLESHEETPATH . '/functions.php' ); 327 if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) 328 include( TEMPLATEPATH . '/functions.php' ); 325 if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/functions.php' ) ) { 326 include get_stylesheet_directory() . '/functions.php'; 327 } 328 if ( file_exists( get_template_directory() . '/functions.php' ) ) { 329 include get_template_directory() . '/functions.php'; 330 } 329 331 } 330 332 331 333 /**