From 3a9829f9f1f6a81e5b59b01cae5bc611ad45a523 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 4 Dec 2010 10:09:00 +0000 Subject: [PATCH] Introduce remove_editor_styles(). fixes #14903. git-svn-id: https://develop.svn.wordpress.org/trunk@16721 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 8ad3de0dd8..3506bfa044 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1674,6 +1674,10 @@ body { } * the theme root. It also accepts an array of stylesheets. * It is optional and defaults to 'editor-style.css'. * + * Supports RTL stylesheets automatically by searching for the -rtl prefix, e.g. + * editor-style-rtl.css. If an array of stylesheets is passed to add_editor_style(), + * RTL is only added for the first stylesheet. + * * @since 3.0.0 * * @param mixed $stylesheet Optional. Stylesheet name or array thereof, relative to theme root. @@ -1697,6 +1701,22 @@ function add_editor_style( $stylesheet = 'editor-style.css' ) { $editor_styles = array_merge( $editor_styles, $stylesheet ); } +/** + * Removes all visual editor stylesheets. + * + * @since 3.1.0 + * + * @return bool True on success, false if there were no stylesheets to remove. + */ +function remove_editor_styles() { + if ( ! current_theme_supports( 'editor-style' ) ) + return false; + _remove_theme_support( 'editor-style' ); + if ( is_admin() ) + $GLOBALS['editor_styles'] = array(); + return true; +} + /** * Allows a theme to register its support of a certain feature *