From 45748141c012185b018bdc6e0206418c02caeb04 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 26 Feb 2010 20:12:06 +0000 Subject: [PATCH] Introduce add_editor_style() to easily register a stylesheet for the visual editor. see #11512 see #9015 git-svn-id: http://svn.automattic.com/wordpress/trunk@13441 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyten/functions.php | 17 ++--------- wp-includes/theme.php | 37 +++++++++++++++++++++++ 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index d0257cffa..08446ee16 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -28,6 +28,9 @@ function twentyten_init() { add_custom_background(); + // This theme styles the visual editor with editor-style.css to match the theme style. + add_editor_style(); + // This theme needs post thumbnails add_theme_support( 'post-thumbnails' ); @@ -134,20 +137,6 @@ function twentyten_comment( $comment, $args, $depth ) { } endif; -// Make the Visual Editor styles match the theme's styles -if ( ! function_exists( 'twentyten_editor_style' ) ) : -function twentyten_editor_style( $url ) { - if ( ! empty( $url ) ) - $url .= ','; - - // Change the path here if using sub-directory - $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css'; - - return $url; -} -endif; -add_filter( 'mce_css', 'twentyten_editor_style' ); - // Remove inline styles on gallery shortcode if ( ! function_exists( 'twentyten_remove_gallery_css' ) ) : function twentyten_remove_gallery_css() { diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 8b29dff66..741c66d36 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1446,6 +1446,43 @@ body {