diff --git a/wp-admin/load-styles.php b/wp-admin/load-styles.php index d2f8bfbdee..c51355d720 100644 --- a/wp-admin/load-styles.php +++ b/wp-admin/load-styles.php @@ -117,13 +117,13 @@ foreach( $load as $handle ) { $style = $wp_styles->registered[$handle]; $path = ABSPATH . $style->src; - $content = get_file($path) . "\n"; - - if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) { - $rtl_path = is_bool($style->extra['rtl']) ? str_replace( '.min.css', '-rtl.min.css', $path ) : ABSPATH . $style->extra['rtl']; - $content .= get_file($rtl_path) . "\n"; + if ( $rtl && ! empty( $style->extra['rtl'] ) ) { + // All default styles have fully independent RTL files. + $path = str_replace( '.min.css', '-rtl.min.css', $path ); } + $content = get_file( $path ) . "\n"; + if ( strpos( $style->src, '/wp-includes/css/' ) === 0 ) { $content = str_replace( '../images/', '../wp-includes/images/', $content ); $out .= str_replace( '../js/tinymce/', '../wp-includes/js/tinymce/', $content ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index a22e3888e5..76da68b4b8 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -591,6 +591,9 @@ function wp_default_styles( &$styles ) { foreach ( $rtl_styles as $rtl_style ) { $styles->add_data( $rtl_style, 'rtl', 'replace' ); + if ( $suffix ) { + $styles->add_data( $rtl_style, 'suffix', $suffix ); + } } }