Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace references to TEMPLATEPATH and STYLESHEETPATH with calls to g…

…et_template_directory and get_stylesheet_directory functions.
  • Loading branch information...
commit 6cf6bcc09ac43af5ede37bf19ffc35dce0af3765 1 parent 1f07624
@beastaugh beastaugh authored
View
12 functions.php
@@ -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
12 library/core.php
@@ -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 ||
View
6 library/helpers/admin_helper.php
@@ -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';
Please sign in to comment.
Something went wrong with that request. Please try again.