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
This commit is contained in:
Andrew Nacin 2013-11-13 05:10:10 +00:00
parent 5b8bd6e5ae
commit 1b3e9d33ce
2 changed files with 8 additions and 5 deletions

View File

@ -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 );

View File

@ -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 );
}
}
}