Make WordPress Core


Ignore:
Timestamp:
03/01/2012 12:18:26 AM (14 years ago)
Author:
azaozz
Message:

Don't pass non-existing rtl stylesheet to TinyMCE, update phpdoc for add_editor_style(), see #19437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-editor.php

    r19945 r20059  
    329329                    $editor_styles = array_unique($editor_styles);
    330330                    $style_uri = get_stylesheet_directory_uri();
    331                     if ( ! is_child_theme() ) {
    332                         foreach ( $editor_styles as $file )
     331                    $style_dir = get_stylesheet_directory();
     332
     333                    foreach ( $editor_styles as $key => $file ) {
     334                        if ( $file && file_exists( "$style_dir/$file" ) ) {
    333335                            $mce_css[] = "$style_uri/$file";
    334                     } else {
    335                         $style_dir    = get_stylesheet_directory();
     336                            $editor_styles[$key] = '';
     337                        }
     338                    }
     339
     340                    if ( is_child_theme() ) {
    336341                        $template_uri = get_template_directory_uri();
    337342                        $template_dir = get_template_directory();
    338343
    339344                        foreach ( $editor_styles as $file ) {
    340                             if ( file_exists( "$template_dir/$file" ) )
     345                            if ( $file && file_exists( "$template_dir/$file" ) )
    341346                                $mce_css[] = "$template_uri/$file";
    342347                        }
    343 
    344                         foreach ( $editor_styles as $file ) {
    345                             if ( file_exists( "$style_dir/$file" ) )
    346                                 $mce_css[] = "$style_uri/$file";
    347                         }
    348348                    }
     349
    349350                    $mce_css = implode( ',', $mce_css );
    350351                } else {
Note: See TracChangeset for help on using the changeset viewer.