Make WordPress Core

Ticket #18298: 18298.diff

File 18298.diff, 3.7 KB (added by aaroncampbell, 13 years ago)
  • wp-includes/theme.php

     
    1414 * @return bool true if a child theme is in use, false otherwise.
    1515 **/
    1616function is_child_theme() {
    17         return ( TEMPLATEPATH !== STYLESHEETPATH );
     17        return ( get_template_directory() !== get_stylesheet_directory() );
    1818}
    1919
    2020/**
     
    10621062/**
    10631063 * Retrieve the name of the highest priority template file that exists.
    10641064 *
    1065  * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
     1065 * Searches in the stylesheet path before template path so that themes which
    10661066 * inherit from a parent theme can just overload one file.
    10671067 *
    10681068 * @since 2.7.0
     
    10771077        foreach ( (array) $template_names as $template_name ) {
    10781078                if ( !$template_name )
    10791079                        continue;
    1080                 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
    1081                         $located = STYLESHEETPATH . '/' . $template_name;
     1080                if ( file_exists(get_stylesheet_directory() . '/' . $template_name)) {
     1081                        $located = get_stylesheet_directory() . '/' . $template_name;
    10821082                        break;
    1083                 } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
    1084                         $located = TEMPLATEPATH . '/' . $template_name;
     1083                } else if ( file_exists(get_template_directory() . '/' . $template_name) ) {
     1084                        $located = get_template_directory() . '/' . $template_name;
    10851085                        break;
    10861086                }
    10871087        }
  • wp-includes/comment-template.php

     
    831831 * and the post ID respectively.
    832832 *
    833833 * The $file path is passed through a filter hook called, 'comments_template'
    834  * which includes the TEMPLATEPATH and $file combined. Tries the $filtered path
     834 * which includes the template path and $file combined. Tries the $filtered path
    835835 * first and if it fails it will require the default comment themplate from the
    836836 * default theme. If either does not exist, then the WordPress process will be
    837837 * halted. It is advised for that reason, that the default theme is not deleted.
     
    908908        if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE)
    909909                define('COMMENTS_TEMPLATE', true);
    910910
    911         $include = apply_filters('comments_template', STYLESHEETPATH . $file );
     911        $include = apply_filters('comments_template', get_stylesheet_directory() . $file );
    912912        if ( file_exists( $include ) )
    913913                require( $include );
    914         elseif ( file_exists( TEMPLATEPATH . $file ) )
    915                 require( TEMPLATEPATH .  $file );
     914        elseif ( file_exists( get_template_directory() . $file ) )
     915                require( get_template_directory() .  $file );
    916916        else // Backward compat code will be removed in a future release
    917917                require( ABSPATH . WPINC . '/theme-compat/comments.php');
    918918}
  • wp-settings.php

     
    278278
    279279// Load the functions for the active theme, for both parent and child theme if applicable.
    280280if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
    281         if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
    282                 include( STYLESHEETPATH . '/functions.php' );
    283         if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
    284                 include( TEMPLATEPATH . '/functions.php' );
     281        if ( get_template_directory() !== get_stylesheet_directory() && file_exists( get_stylesheet_directory() . '/functions.php' ) )
     282                include( get_stylesheet_directory() . '/functions.php' );
     283        if ( file_exists( get_template_directory() . '/functions.php' ) )
     284                include( get_template_directory() . '/functions.php' );
    285285}
    286286
    287287do_action( 'after_setup_theme' );