Make WordPress Core


Ignore:
Timestamp:
05/23/2014 08:11:08 PM (11 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r27999 r28563  
    323323// Load the functions for the active theme, for both parent and child theme if applicable.
    324324if ( ! 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    }
    329331}
    330332
Note: See TracChangeset for help on using the changeset viewer.