diff --git a/src/wp-content/themes/twentytwentyone/functions.php b/src/wp-content/themes/twentytwentyone/functions.php
index 1139c3b659..78edfde4b6 100644
a
|
b
|
if ( ! function_exists( 'twenty_twenty_one_setup' ) ) { |
140 | 140 | } |
141 | 141 | |
142 | 142 | // Enqueue editor styles. |
143 | | add_editor_style( $editor_stylesheet_path ); |
| 143 | add_editor_style( $editor_stylesheet_path, 'replace' ); |
144 | 144 | |
145 | 145 | // Add custom editor font sizes. |
146 | 146 | add_theme_support( |
diff --git a/src/wp-content/themes/twentytwentyone/package.json b/src/wp-content/themes/twentytwentyone/package.json
index 6c43119fcb..bfa1cc75e5 100644
a
|
b
|
|
55 | 55 | "build:style-dark-mode": "sass assets/sass/style-dark-mode.scss:assets/css/style-dark-mode.css --style=expanded --source-map", |
56 | 56 | "build:rtl": "rtlcss style.css style-rtl.css style-dark-mode.css style-dark-mode-rtl.css", |
57 | 57 | "build:dark-rtl": "rtlcss assets/css/style-dark-mode.css assets/css/style-dark-mode-rtl.css", |
| 58 | "build:style-editor-rtl": "rtlcss assets/css/style-editor.css assets/css/style-editor-rtl.css", |
58 | 59 | "build:print": "sass assets/sass/07-utilities/print.scss:assets/css/print.css --style=expanded --source-map", |
59 | 60 | "build:ie": "postcss style.css -o assets/css/ie.css", |
60 | 61 | "build:ie-editor": "postcss assets/css/style-editor.css -o assets/css/ie-editor.css", |
diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
index 916c836f43..ed63c1989c 100644
a
|
b
|
function wp_update_custom_css_post( $css, $args = array() ) { |
2035 | 2035 | * Since version 3.4 the TinyMCE body has .rtl CSS class. |
2036 | 2036 | * It is a better option to use that class and add any RTL styles to the main stylesheet. |
2037 | 2037 | * |
| 2038 | * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root. |
| 2039 | * Defaults to 'editor-style.css' |
| 2040 | * @param string $rtl_mode Optional. Should the rtl stylesheet be loaded instead or in addition to the main stylesheet. |
| 2041 | * Defaults to 'add' |
| 2042 | * |
2038 | 2043 | * @since 3.0.0 |
2039 | 2044 | * |
2040 | 2045 | * @global array $editor_styles |
2041 | 2046 | * |
2042 | | * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root. |
2043 | | * Defaults to 'editor-style.css' |
2044 | 2047 | */ |
2045 | | function add_editor_style( $stylesheet = 'editor-style.css' ) { |
| 2048 | function add_editor_style( $stylesheet = 'editor-style.css', $rtl_mode = 'add' ) { |
2046 | 2049 | global $editor_styles; |
2047 | 2050 | |
2048 | 2051 | add_theme_support( 'editor-style' ); |
… |
… |
function add_editor_style( $stylesheet = 'editor-style.css' ) { |
2053 | 2056 | if ( is_rtl() ) { |
2054 | 2057 | $rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] ); |
2055 | 2058 | $stylesheet[] = $rtl_stylesheet; |
| 2059 | |
| 2060 | if ( $rtl_mode === 'replace' ) { |
| 2061 | unset( $stylesheet[0] ); |
| 2062 | } |
2056 | 2063 | } |
2057 | 2064 | |
2058 | 2065 | $editor_styles = array_merge( $editor_styles, $stylesheet ); |