Ticket #19437: 19437.child-editor-style.patch

File 19437.child-editor-style.patch, 1.2 KB (added by SergeyBiryukov, 14 months ago)
  • wp-includes/class-wp-editor.php

     
    330330                                        $style_uri = get_stylesheet_directory_uri(); 
    331331                                        $style_dir = get_stylesheet_directory(); 
    332332 
    333                                         foreach ( $editor_styles as $key => $file ) { 
    334                                                 if ( $file && file_exists( "$style_dir/$file" ) ) { 
    335                                                         $mce_css[] = "$style_uri/$file"; 
    336                                                         $editor_styles[$key] = ''; 
    337                                                 } 
    338                                         } 
    339  
    340333                                        if ( is_child_theme() ) { 
    341334                                                $template_uri = get_template_directory_uri(); 
    342335                                                $template_dir = get_template_directory(); 
    343336 
    344                                                 foreach ( $editor_styles as $file ) { 
    345                                                         if ( $file && file_exists( "$template_dir/$file" ) ) 
     337                                                foreach ( $editor_styles as $key => $file ) { 
     338                                                        if ( $file && file_exists( "$template_dir/$file" ) ) { 
    346339                                                                $mce_css[] = "$template_uri/$file"; 
     340                                                                $editor_styles[$key] = ''; 
     341                                                        } 
    347342                                                } 
    348343                                        } 
    349344 
     345                                        foreach ( $editor_styles as $file ) { 
     346                                                if ( $file && file_exists( "$style_dir/$file" ) ) 
     347                                                        $mce_css[] = "$style_uri/$file"; 
     348                                        } 
     349 
    350350                                        $mce_css = implode( ',', $mce_css ); 
    351351                                } else { 
    352352                                        $mce_css = '';