Changeset 45621
- Timestamp:
- 07/11/2019 06:29:09 PM (6 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r45602 r45621 541 541 } 542 542 543 $mce_css = $settings['content_css']; 544 $editor_styles = get_editor_stylesheets(); 545 546 if ( ! empty( $editor_styles ) ) { 547 // Force urlencoding of commas. 548 foreach ( $editor_styles as $key => $url ) { 549 if ( strpos( $url, ',' ) !== false ) { 550 $editor_styles[ $key ] = str_replace( ',', '%2C', $url ); 543 $mce_css = $settings['content_css']; 544 545 // The `editor-style.css` added by the theme is generally intended for the editor instance on the Edit Post screen. 546 // Plugins that use wp_editor() on the front-end can decide whether to add the theme stylesheet 547 // by using `get_editor_stylesheets()` and the `mce_css` or `tiny_mce_before_init` filters, see below. 548 if ( is_admin() ) { 549 $editor_styles = get_editor_stylesheets(); 550 551 if ( ! empty( $editor_styles ) ) { 552 // Force urlencoding of commas. 553 foreach ( $editor_styles as $key => $url ) { 554 if ( strpos( $url, ',' ) !== false ) { 555 $editor_styles[ $key ] = str_replace( ',', '%2C', $url ); 556 } 551 557 } 558 559 $mce_css .= ',' . implode( ',', $editor_styles ); 552 560 } 553 554 $mce_css .= ',' . implode( ',', $editor_styles );555 561 } 556 562 -
trunk/src/wp-includes/theme.php
r45599 r45621 1925 1925 */ 1926 1926 function add_editor_style( $stylesheet = 'editor-style.css' ) { 1927 global $editor_styles; 1928 1927 1929 add_theme_support( 'editor-style' ); 1928 1930 1929 if ( ! is_admin() ) {1930 return;1931 }1932 1933 global $editor_styles;1934 1931 $editor_styles = (array) $editor_styles; 1935 1932 $stylesheet = (array) $stylesheet; 1933 1936 1934 if ( is_rtl() ) { 1937 1935 $rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] );
Note: See TracChangeset
for help on using the changeset viewer.