diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc
index 896fc84..092ec70 100644
--- a/editors/ckeditor.inc
+++ b/editors/ckeditor.inc
@@ -167,7 +167,8 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) {
         $settings['contentsCss'] = reset(wysiwyg_get_css());
       }
       elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-        $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+        global $theme;
+        $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
       }
     }
     else {
@@ -175,7 +176,8 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) {
         $settings['contentsCss'] = wysiwyg_get_css();
       }
       elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-        $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())));
+        global $theme;
+        $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme))));
       }
     }
   }
diff --git a/editors/fckeditor.inc b/editors/fckeditor.inc
index fba81f6..9c6412d 100644
--- a/editors/fckeditor.inc
+++ b/editors/fckeditor.inc
@@ -132,7 +132,8 @@ function wysiwyg_fckeditor_settings($editor, $config, $theme) {
       $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
diff --git a/editors/nicedit.inc b/editors/nicedit.inc
index 55404b8..3d40a49 100644
--- a/editors/nicedit.inc
+++ b/editors/nicedit.inc
@@ -77,13 +77,15 @@ function wysiwyg_nicedit_settings($editor, $config, $theme) {
   // Add editor content stylesheet.
   if (isset($config['css_setting'])) {
     if ($config['css_setting'] == 'theme') {
-      $css = path_to_theme() . '/style.css';
+      global $theme;
+      $css = drupal_get_path('theme', $theme) . '/style.css';
       if (file_exists($css)) {
         $settings['externalCSS'] = base_path() . $css;
       }
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
diff --git a/editors/openwysiwyg.inc b/editors/openwysiwyg.inc
index 3a4b66c..c061de2 100644
--- a/editors/openwysiwyg.inc
+++ b/editors/openwysiwyg.inc
@@ -103,7 +103,8 @@ function wysiwyg_openwysiwyg_settings($editor, $config, $theme) {
       $settings['CSSFile'] = reset(wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
@@ -126,7 +127,7 @@ function wysiwyg_openwysiwyg_settings($editor, $config, $theme) {
     }
   }
 
-  // @todo 
+  // @todo
 //  if (isset($config['block_formats'])) {
 //    $settings['DropDowns']['headings']['elements'] = explode(',', $config['block_formats']);
 //  }
diff --git a/editors/tinymce.inc b/editors/tinymce.inc
index b88f07f..49c17e5 100644
--- a/editors/tinymce.inc
+++ b/editors/tinymce.inc
@@ -191,7 +191,8 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
       $settings['content_css'] = implode(',', wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
diff --git a/editors/whizzywig.inc b/editors/whizzywig.inc
index 96c9ead..4c3b2c5 100644
--- a/editors/whizzywig.inc
+++ b/editors/whizzywig.inc
@@ -104,13 +104,15 @@ function wysiwyg_whizzywig_settings($editor, $config, $theme) {
   // Add editor content stylesheet.
   if (isset($config['css_setting'])) {
     if ($config['css_setting'] == 'theme') {
-      $css = path_to_theme() . '/style.css';
+      global $theme;
+      $css = drupal_get_path('theme', $theme) . '/style.css';
       if (file_exists($css)) {
         $settings['externalCSS'] = base_path() . $css;
       }
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
diff --git a/editors/wymeditor.inc b/editors/wymeditor.inc
index 042bc23..c4a00ae 100644
--- a/editors/wymeditor.inc
+++ b/editors/wymeditor.inc
@@ -175,7 +175,8 @@ function wysiwyg_wymeditor_settings($editor, $config, $theme) {
       $settings['stylesheet'] = reset(wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
     }
   }
 
diff --git a/editors/yui.inc b/editors/yui.inc
index 845a1af..272cf69 100644
--- a/editors/yui.inc
+++ b/editors/yui.inc
@@ -203,7 +203,8 @@ function wysiwyg_yui_settings($editor, $config, $theme) {
       $settings['extracss'] = wysiwyg_get_css();
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      global $theme;
+      $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme)));
       $settings['extracss'] = explode(',', $settings['extracss']);
     }
     // YUI only supports inline CSS, so we need to use @import directives.
