diff --git a/includes/styling.inc b/includes/styling.inc index ce2547d..4713b47 100644 --- a/includes/styling.inc +++ b/includes/styling.inc @@ -78,7 +78,13 @@ function _wysiwyg_filter_editor_styles(&$elements) { return $elements; } $context = array('theme' => $theme_key); - drupal_alter('wysiwyg_editor_styles', $elements, $context); $css = array(); + // Remove any styles that aren't CSS_THEME before processing. + foreach ($elements['#items'] as $key => $css) { + if (isset($css['group']) && $css['group'] != CSS_THEME) { + unset($elements['#items'][$key]); + } + } + drupal_alter('wysiwyg_editor_styles', $elements, $context); return $elements; } @@ -102,9 +108,6 @@ function _wysiwyg_pre_render_styles($elements) { } $cached = cache_get('wysiwyg_css'); foreach (element_children($elements) as $child) { - if (isset($elements['#groups'][$child]['group']) && $elements['#groups'][$child]['group'] != CSS_THEME) { - continue; - } switch ($elements[$child]['#tag']) { case 'link': $css[] = $elements[$child]['#attributes']['href'];