Permalink
Browse files

Replace references to TEMPLATEPATH and STYLESHEETPATH with calls to g…

…et_template_directory and get_stylesheet_directory functions.
  • Loading branch information...
1 parent 1f07624 commit 6cf6bcc09ac43af5ede37bf19ffc35dce0af3765 @beastaugh beastaugh committed Aug 27, 2011
Showing with 15 additions and 15 deletions.
  1. +6 −6 functions.php
  2. +6 −6 library/core.php
  3. +3 −3 library/helpers/admin_helper.php
View
@@ -12,9 +12,9 @@
* keeping includes simple is greatly helped by a sane set of path constants.
*/
define('TARSKI_DEBUG', false);
-define('TARSKICLASSES', TEMPLATEPATH . '/library/classes');
-define('TARSKIHELPERS', TEMPLATEPATH . '/library/helpers');
-define('TARSKIDISPLAY', TEMPLATEPATH . '/app/templates');
+define('TARSKICLASSES', get_template_directory() . '/library/classes');
+define('TARSKIHELPERS', get_template_directory() . '/library/helpers');
+define('TARSKIDISPLAY', get_template_directory() . '/app/templates');
/**
* Core library files.
@@ -26,7 +26,7 @@
* @see Options
* @see TarskiCommentWalker
*/
-require(TEMPLATEPATH . '/library/core.php');
+require(get_template_directory() . '/library/core.php');
require(TARSKICLASSES . '/options.php');
require(TARSKICLASSES . '/comment_walker.php');
@@ -62,8 +62,8 @@
* legacy API handlers, and deprecated functions, all live in specialised API
* files where they can be easily found and documented.
*/
-require(TEMPLATEPATH . '/app/api/hooks.php');
-include(TEMPLATEPATH . '/app/api/deprecated.php');
+require(get_template_directory() . '/app/api/hooks.php');
+include(get_template_directory() . '/app/api/deprecated.php');
/**
* Launcher.
View
@@ -11,7 +11,7 @@
* @return string
*/
function theme_version() {
- $themedata = get_theme_data(TEMPLATEPATH . '/style.css');
+ $themedata = get_theme_data(get_template_directory() . '/style.css');
$version = trim($themedata['Version']);
return strlen($version) > 0 ? $version : '';
@@ -68,12 +68,12 @@ function tarski_asset_path($path) {
*/
function _tarski_list_header_images() {
$headers = array();
- $dirs = array('Tarski' => TEMPLATEPATH);
+ $dirs = array('Tarski' => get_template_directory());
$current = get_tarski_option('header');
$theme = get_current_theme();
- if (TEMPLATEPATH != STYLESHEETPATH)
- $dirs[$theme] = STYLESHEETPATH;
+ if (get_template_directory() != get_stylesheet_directory())
+ $dirs[$theme] = get_stylesheet_directory();
foreach ($dirs as $theme => $dir) {
$dirpath = $dir . '/headers';
@@ -88,9 +88,9 @@ function _tarski_list_header_images() {
!preg_match('/-thumb\.(jpg|png|gif)$/', $file)) {
$name = $theme . '/' . $file;
$id = 'header_' . preg_replace('/[^a-z_]/', '_', strtolower($name));
- $path = $dir == TEMPLATEPATH ? '%1$s' : '%2$s';
+ $path = $dir == get_template_directory() ? '%1$s' : '%2$s';
$thumb = preg_replace('/(\.(?:png|gif|jpg))/', '-thumb\\1', $file);
- $uri = ($dir == TEMPLATEPATH
+ $uri = ($dir == get_template_directory()
? get_template_directory_uri()
: get_stylesheet_directory_uri());
$is_current = is_string($current) && $current == $file ||
@@ -262,12 +262,12 @@ function tarski_inject_styles() {
*/
function _tarski_list_alternate_styles() {
$styles = array();
- $dirs = array('Tarski' => TEMPLATEPATH);
+ $dirs = array('Tarski' => get_template_directory());
$current_style = get_tarski_option('style');
$current_theme = get_current_theme();
- if (TEMPLATEPATH != STYLESHEETPATH)
- $dirs[$current_theme] = STYLESHEETPATH;
+ if (get_template_directory() != get_stylesheet_directory())
+ $dirs[$current_theme] = get_stylesheet_directory();
foreach ($dirs as $theme => $dir) {
$dirpath = $dir . '/styles';

0 comments on commit 6cf6bcc

Please sign in to comment.