From 1b3e9d33ceb854372d2a6398399a5e5b5d058ba2 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 13 Nov 2013 05:10:10 +0000 Subject: [PATCH] Fix new RTL file loading when style concatenation is enabled. see #24977. Built from https://develop.svn.wordpress.org/trunk@26128 git-svn-id: http://core.svn.wordpress.org/trunk@26040 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/load-styles.php | 10 +++++----- wp-includes/script-loader.php | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) 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 ); + } } }