WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/27/2010 07:36:35 AM (10 years ago)
Author:
nacin
Message:

add_editor_style() third pass. better performance and better child theme support. see #11512

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r13242 r13453  
    13061306 */
    13071307function wp_tiny_mce( $teeny = false, $settings = false ) {
    1308     global $concatenate_scripts, $compress_scripts, $tinymce_version;
     1308    global $concatenate_scripts, $compress_scripts, $tinymce_version, $editor_styles;
    13091309
    13101310    if ( ! user_can_richedit() )
     
    14681468    );
    14691469
    1470     $mce_css = trim(apply_filters('mce_css', ''), ' ,');
     1470    if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
     1471        $mce_css = array();
     1472        $style_uri = get_stylesheet_directory_uri();
     1473        if ( TEMPLATEPATH == STYLESHEETPATH ) {
     1474            foreach ( $editor_styles as $file )
     1475                $mce_css[] = "$style_uri/$file";
     1476        } else {
     1477            $style_dir    = get_stylesheet_directory();
     1478            $template_uri = get_template_directory_uri();
     1479            $template_dir = get_template_directory();
     1480            foreach ( $editor_styles as $file ) {
     1481                if ( file_exists( "$style_dir/$file" ) )
     1482                    $mce_css[] = "$style_uri/$file";
     1483                if ( file_exists( "$template_dir/$file" ) )
     1484                    $mce_css[] = "$template_uri/$file";
     1485            }
     1486        }
     1487        $mce_css = implode( ',', $mce_css );
     1488    } else {
     1489        $mce_css = '';
     1490    }
     1491
     1492    $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
    14711493
    14721494    if ( ! empty($mce_css) )
Note: See TracChangeset for help on using the changeset viewer.