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-includes/template.php

    r26906 r28563  
    450450 * Retrieve the name of the highest priority template file that exists.
    451451 *
    452  * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
     452 * Searches in the stylesheet path before template path so that themes which
    453453 * inherit from a parent theme can just overload one file.
    454454 *
     
    465465        if ( !$template_name )
    466466            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;
    469469            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;
    472472            break;
    473473        }
Note: See TracChangeset for help on using the changeset viewer.