Skip to content
Permalink
Browse files

Script Loader: Pass the suffix to package style handles to ensure cor…

…rect file names for minified RTL stylesheets.

See #45547.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44231 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
ocean90 committed Dec 16, 2018
1 parent 7ba3613 commit 35623ef0723517c0591d69ea5b7e4cd9a2737d0c
Showing with 24 additions and 24 deletions.
  1. +24 −24 src/wp-includes/script-loader.php
@@ -1763,26 +1763,6 @@ function wp_default_styles( &$styles ) {
$styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle.
$styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6
// RTL CSS
$rtl_styles = array(
// wp-admin
'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
'ie', 'login',
// wp-includes
'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
'wp-jquery-ui-dialog',
// deprecated
'deprecated-media', 'farbtastic',
);
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', 'replace' );
if ( $suffix ) {
$styles->add_data( $rtl_style, 'suffix', $suffix );
}
}
// Packages styles
$fonts_url = '';
@@ -1798,7 +1778,6 @@ function wp_default_styles( &$styles ) {
$styles->add( 'wp-editor-font', $fonts_url );
$styles->add( 'wp-block-library-theme', "/wp-includes/css/dist/block-library/theme$suffix.css" );
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
$styles->add(
'wp-edit-blocks',
@@ -1811,7 +1790,6 @@ function wp_default_styles( &$styles ) {
'wp-block-library-theme',
)
);
$styles->add_data( 'wp-edit-blocks', 'rtl', 'replace' );
$package_styles = array(
'block-library' => array(),
@@ -1825,10 +1803,32 @@ function wp_default_styles( &$styles ) {
foreach ( $package_styles as $package => $dependencies ) {
$handle = 'wp-' . $package;
$path = "/wp-includes/css/dist/$package/style$suffix.css";
$path = "/wp-includes/css/dist/$package/style$suffix.css";
$styles->add( $handle, $path, $dependencies );
$styles->add_data( $handle, 'rtl', 'replace' );
}
// RTL CSS
$rtl_styles = array(
// Admin CSS
'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
'ie', 'login',
// Includes CSS
'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
'wp-jquery-ui-dialog',
// Package styles
'wp-block-library-theme', 'wp-edit-blocks', 'wp-block-library', 'wp-components', 'wp-edit-post', 'wp-editor', 'wp-format-library',
'wp-list-reusable-blocks', 'wp-nux',
// Deprecated CSS
'deprecated-media', 'farbtastic',
);
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', 'replace' );
if ( $suffix ) {
$styles->add_data( $rtl_style, 'suffix', $suffix );
}
}
}

0 comments on commit 35623ef

Please sign in to comment.
You can’t perform that action at this time.