Ticket #34882: 34882.diff
File 34882.diff, 2.2 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
538 538 $settings['wpeditimage_disable_captions'] = true; 539 539 } 540 540 541 $mce_css = $settings['content_css']; 542 $editor_styles = get_editor_stylesheets(); 541 $mce_css = $settings['content_css']; 543 542 544 if ( ! empty( $editor_styles ) ) { 545 // Force urlencoding of commas. 546 foreach ( $editor_styles as $key => $url ) { 547 if ( strpos( $url, ',' ) !== false ) { 548 $editor_styles[ $key ] = str_replace( ',', '%2C', $url ); 543 // The `editor-style.css` added by the theme is generally intended for the editor instance on the Edit Post screen. 544 // Plugins that use wp_editor() on the front-end can decide whether to add the theme stylesheet 545 // by using `get_editor_stylesheets()` and the `mce_css` or `tiny_mce_before_init` filters, see below. 546 if ( is_admin() ) { 547 $editor_styles = get_editor_stylesheets(); 548 549 if ( ! empty( $editor_styles ) ) { 550 // Force urlencoding of commas. 551 foreach ( $editor_styles as $key => $url ) { 552 if ( strpos( $url, ',' ) !== false ) { 553 $editor_styles[ $key ] = str_replace( ',', '%2C', $url ); 554 } 549 555 } 556 557 $mce_css .= ',' . implode( ',', $editor_styles ); 550 558 } 551 552 $mce_css .= ',' . implode( ',', $editor_styles );553 559 } 554 560 555 561 /** -
src/wp-includes/theme.php
1914 1914 * Defaults to 'editor-style.css' 1915 1915 */ 1916 1916 function add_editor_style( $stylesheet = 'editor-style.css' ) { 1917 global $editor_styles; 1918 1917 1919 add_theme_support( 'editor-style' ); 1918 1920 1919 if ( ! is_admin() ) {1920 return;1921 }1922 1923 global $editor_styles;1924 1921 $editor_styles = (array) $editor_styles; 1925 1922 $stylesheet = (array) $stylesheet; 1923 1926 1924 if ( is_rtl() ) { 1927 1925 $rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] ); 1928 1926 $stylesheet[] = $rtl_stylesheet;