Changeset 29177
- Timestamp:
- 07/15/2014 10:00:34 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r29049 r29177 515 515 ); 516 516 517 // load editor_style.css if the current theme supports it 518 if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) { 519 $editor_styles = $GLOBALS['editor_styles']; 520 521 $editor_styles = array_unique( array_filter( $editor_styles ) ); 522 $style_uri = get_stylesheet_directory_uri(); 523 $style_dir = get_stylesheet_directory(); 524 525 // Support externally referenced styles (like, say, fonts). 526 foreach ( $editor_styles as $key => $file ) { 527 if ( preg_match( '~^(https?:)?//~', $file ) ) { 528 $mce_css[] = esc_url_raw( $file ); 529 unset( $editor_styles[ $key ] ); 530 } 531 } 532 533 // Look in a parent theme first, that way child theme CSS overrides. 534 if ( is_child_theme() ) { 535 $template_uri = get_template_directory_uri(); 536 $template_dir = get_template_directory(); 537 538 foreach ( $editor_styles as $key => $file ) { 539 if ( $file && file_exists( "$template_dir/$file" ) ) 540 $mce_css[] = "$template_uri/$file"; 541 } 542 } 543 544 foreach ( $editor_styles as $file ) { 545 if ( $file && file_exists( "$style_dir/$file" ) ) 546 $mce_css[] = "$style_uri/$file"; 517 $editor_styles = get_editor_stylesheets(); 518 if ( ! empty( $editor_styles ) ) { 519 foreach ( $editor_styles as $style ) { 520 $mce_css[] = $style; 547 521 } 548 522 }
Note: See TracChangeset
for help on using the changeset viewer.