diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc
index 896fc84..75e2bf0 100644
--- a/editors/ckeditor.inc
+++ b/editors/ckeditor.inc
@@ -118,14 +118,14 @@ function wysiwyg_ckeditor_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_ckeditor_settings($editor, $config, $theme) {
+function wysiwyg_ckeditor_settings($editor, $config, $editor_theme) {
   $settings = array(
     'baseHref' => $GLOBALS['base_url'] . '/',
     'width' => '100%',
@@ -134,7 +134,7 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) {
     'height' => 420,
     // @todo Do not use skins as themes and add separate skin handling.
     'theme' => 'default',
-    'skin' => !empty($theme) ? $theme : 'kama',
+    'skin' => !empty($editor_theme) ? $editor_theme : 'kama',
     // By default, CKEditor converts most characters into HTML entities. Since
     // it does not support a custom definition, but Drupal supports Unicode, we
     // disable at least the additional character sets. CKEditor always converts
@@ -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..91ca658 100644
--- a/editors/fckeditor.inc
+++ b/editors/fckeditor.inc
@@ -89,17 +89,17 @@ function wysiwyg_fckeditor_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_fckeditor_settings($editor, $config, $theme) {
+function wysiwyg_fckeditor_settings($editor, $config, $editor_theme) {
   $settings = array(
     'EditorPath' => base_path() . $editor['library path'] . '/',
-    'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $theme . '/',
+    'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $editor_theme . '/',
     'CustomConfigurationsPath' => base_path() . drupal_get_path('module', 'wysiwyg') . '/editors/js/fckeditor.config.js',
     'Width' => '100%',
     'Height' => 420,
@@ -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/markitup.inc b/editors/markitup.inc
index 57a37e8..92198c6 100644
--- a/editors/markitup.inc
+++ b/editors/markitup.inc
@@ -88,24 +88,24 @@ function wysiwyg_markitup_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_markitup_settings($editor, $config, $theme) {
-  drupal_add_css($editor['library path'] . '/markitup/skins/' . $theme . '/style.css', array(
+function wysiwyg_markitup_settings($editor, $config, $editor_theme) {
+  drupal_add_css($editor['library path'] . '/markitup/skins/' . $editor_theme . '/style.css', array(
     // Specify an alternate basename; otherwise, style.css would override a
     // commonly used style.css file of the theme.
-    'basename' => 'markitup.' . $theme . '.style.css',
+    'basename' => 'markitup.' . $editor_theme . '.style.css',
     'group' => CSS_THEME,
   ));
 
   $settings = array(
     'root' => base_path() . $editor['library path'] . '/markitup/',
-    'nameSpace' => $theme,
+    'nameSpace' => $editor_theme,
     'markupSet' => array(),
   );
 
diff --git a/editors/nicedit.inc b/editors/nicedit.inc
index 55404b8..401666e 100644
--- a/editors/nicedit.inc
+++ b/editors/nicedit.inc
@@ -52,14 +52,14 @@ function wysiwyg_nicedit_version($editor) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_nicedit_settings($editor, $config, $theme) {
+function wysiwyg_nicedit_settings($editor, $config, $editor_theme) {
   $settings = array(
     'iconsPath' => base_path() . $editor['library path'] . '/nicEditorIcons.gif',
   );
@@ -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..2544076 100644
--- a/editors/openwysiwyg.inc
+++ b/editors/openwysiwyg.inc
@@ -81,14 +81,14 @@ function wysiwyg_openwysiwyg_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_openwysiwyg_settings($editor, $config, $theme) {
+function wysiwyg_openwysiwyg_settings($editor, $config, $editor_theme) {
   $settings = array(
     'path' => base_path() . $editor['editor path'] . '/',
     'Width' => '100%',
@@ -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..6bb5130 100644
--- a/editors/tinymce.inc
+++ b/editors/tinymce.inc
@@ -132,20 +132,20 @@ function wysiwyg_tinymce_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_tinymce_settings($editor, $config, $theme) {
+function wysiwyg_tinymce_settings($editor, $config, $editor_theme) {
   $settings = array(
     'button_tile_map' => TRUE, // @todo Add a setting for this.
     'document_base_url' => base_path(),
     'mode' => 'none',
     'plugins' => array(),
-    'theme' => $theme,
+    'theme' => $editor_theme,
     'width' => '100%',
     // Strict loading mode must be enabled; otherwise TinyMCE would use
     // document.write() in IE and Chrome.
@@ -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)));
     }
   }
 
@@ -261,7 +262,7 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
   }
 
   // Add theme-specific settings.
-  switch ($theme) {
+  switch ($editor_theme) {
     case 'advanced':
       $settings += array(
         'theme_advanced_resize_horizontal' => FALSE,
diff --git a/editors/whizzywig.inc b/editors/whizzywig.inc
index 96c9ead..f9ebec1 100644
--- a/editors/whizzywig.inc
+++ b/editors/whizzywig.inc
@@ -69,14 +69,14 @@ function wysiwyg_whizzywig_version($editor) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_whizzywig_settings($editor, $config, $theme) {
+function wysiwyg_whizzywig_settings($editor, $config, $editor_theme) {
   $settings = array();
 
   // Add path to button images, if available.
@@ -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..e03b761 100644
--- a/editors/wymeditor.inc
+++ b/editors/wymeditor.inc
@@ -88,14 +88,14 @@ function wysiwyg_wymeditor_themes($editor, $profile) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_wymeditor_settings($editor, $config, $theme) {
+function wysiwyg_wymeditor_settings($editor, $config, $editor_theme) {
   // @todo Setup $library in wysiwyg_load_editor() already.
   $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries']));
   $settings = array(
@@ -104,7 +104,7 @@ function wysiwyg_wymeditor_settings($editor, $config, $theme) {
     // @todo Does not work in Drupal; jQuery can live anywhere.
     'jQueryPath' => base_path() . 'misc/jquery.js',
     'updateSelector' => '.form-submit',
-    'skin' => $theme,
+    'skin' => $editor_theme,
   );
 
   if (isset($config['language'])) {
@@ -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..17ecd72 100644
--- a/editors/yui.inc
+++ b/editors/yui.inc
@@ -119,16 +119,16 @@ function wysiwyg_yui_load($editor, $library) {
  *   A processed hook_editor() array of editor properties.
  * @param $config
  *   An array containing wysiwyg editor profile settings.
- * @param $theme
+ * @param $editor_theme
  *   The name of a theme/GUI/skin to use.
  *
  * @return
  *   A settings array to be populated in
  *   Drupal.settings.wysiwyg.configs.{editor}
  */
-function wysiwyg_yui_settings($editor, $config, $theme) {
+function wysiwyg_yui_settings($editor, $config, $editor_theme) {
   $settings = array(
-    'theme' => $theme,
+    'theme' => $editor_theme,
     'animate' => TRUE,
     'handleSubmit' => TRUE,
     'markup' => 'xhtml',
@@ -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.
diff --git a/wysiwyg.module b/wysiwyg.module
index 31f3228..6e32d42 100644
--- a/wysiwyg.module
+++ b/wysiwyg.module
@@ -195,12 +195,12 @@ function wysiwyg_pre_render_text_format($element) {
         $settings[$format]['toggle'] = (int) $profile->settings['show_toggle'];
       }
       // Check editor theme (and reset it if not/no longer available).
-      $theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : ''));
+      $editor_theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : ''));
 
       // Add plugin settings (first) for this text format.
       wysiwyg_add_plugin_settings($profile);
       // Add profile settings for this text format.
-      wysiwyg_add_editor_settings($profile, $theme);
+      wysiwyg_add_editor_settings($profile, $editor_theme);
     }
   }
   // Use a hidden element for a single text format.
@@ -388,11 +388,11 @@ function wysiwyg_load_editor($profile) {
 /**
  * Add editor settings for a given input format.
  */
-function wysiwyg_add_editor_settings($profile, $theme) {
+function wysiwyg_add_editor_settings($profile, $editor_theme) {
   static $formats = array();
 
   if (!isset($formats[$profile->format])) {
-    $config = wysiwyg_get_editor_config($profile, $theme);
+    $config = wysiwyg_get_editor_config($profile, $editor_theme);
     // drupal_to_js() does not properly convert numeric array keys, so we need
     // to use a string instead of the format id.
     if ($config) {
@@ -583,14 +583,14 @@ function wysiwyg_get_plugins($editor_name) {
 /**
  * Return an array of initial editor settings for a Wysiwyg profile.
  */
-function wysiwyg_get_editor_config($profile, $theme) {
+function wysiwyg_get_editor_config($profile, $editor_theme) {
   $editor = wysiwyg_get_editor($profile->editor);
   $settings = array();
   if (!empty($editor['settings callback']) && function_exists($editor['settings callback'])) {
-    $settings = $editor['settings callback']($editor, $profile->settings, $theme);
+    $settings = $editor['settings callback']($editor, $profile->settings, $editor_theme);
 
     // Allow other modules to alter the editor settings for this format.
-    $context = array('editor' => $editor, 'profile' => $profile, 'theme' => $theme);
+    $context = array('editor' => $editor, 'profile' => $profile, 'theme' => $editor_theme);
     drupal_alter('wysiwyg_editor_settings', $settings, $context);
   }
   return $settings;
