WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/26/2010 08:12:06 PM (10 years ago)
Author:
nacin
Message:

Introduce add_editor_style() to easily register a stylesheet for the visual editor. see #11512 see #9015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r13417 r13441  
    2828
    2929    add_custom_background();
     30
     31    // This theme styles the visual editor with editor-style.css to match the theme style.
     32    add_editor_style();
    3033
    3134    // This theme needs post thumbnails
     
    134137}
    135138endif;
    136 
    137 // Make the Visual Editor styles match the theme's styles
    138 if ( ! function_exists( 'twentyten_editor_style' ) ) :
    139 function twentyten_editor_style( $url ) {
    140     if ( ! empty( $url ) )
    141         $url .= ',';
    142 
    143     // Change the path here if using sub-directory
    144     $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css';
    145 
    146     return $url;
    147 }
    148 endif;
    149 add_filter( 'mce_css', 'twentyten_editor_style' );
    150139
    151140// Remove inline styles on gallery shortcode
Note: See TracChangeset for help on using the changeset viewer.