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:
parent
5b8bd6e5ae
commit
1b3e9d33ce
|
@ -117,13 +117,13 @@ foreach( $load as $handle ) {
|
||||||
$style = $wp_styles->registered[$handle];
|
$style = $wp_styles->registered[$handle];
|
||||||
$path = ABSPATH . $style->src;
|
$path = ABSPATH . $style->src;
|
||||||
|
|
||||||
$content = get_file($path) . "\n";
|
if ( $rtl && ! empty( $style->extra['rtl'] ) ) {
|
||||||
|
// All default styles have fully independent RTL files.
|
||||||
if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) {
|
$path = str_replace( '.min.css', '-rtl.min.css', $path );
|
||||||
$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";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$content = get_file( $path ) . "\n";
|
||||||
|
|
||||||
if ( strpos( $style->src, '/wp-includes/css/' ) === 0 ) {
|
if ( strpos( $style->src, '/wp-includes/css/' ) === 0 ) {
|
||||||
$content = str_replace( '../images/', '../wp-includes/images/', $content );
|
$content = str_replace( '../images/', '../wp-includes/images/', $content );
|
||||||
$out .= str_replace( '../js/tinymce/', '../wp-includes/js/tinymce/', $content );
|
$out .= str_replace( '../js/tinymce/', '../wp-includes/js/tinymce/', $content );
|
||||||
|
|
|
@ -591,6 +591,9 @@ function wp_default_styles( &$styles ) {
|
||||||
|
|
||||||
foreach ( $rtl_styles as $rtl_style ) {
|
foreach ( $rtl_styles as $rtl_style ) {
|
||||||
$styles->add_data( $rtl_style, 'rtl', 'replace' );
|
$styles->add_data( $rtl_style, 'rtl', 'replace' );
|
||||||
|
if ( $suffix ) {
|
||||||
|
$styles->add_data( $rtl_style, 'suffix', $suffix );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue