Script Loader: Pass the suffix to package style handles to ensure correct file names for minified RTL stylesheets.

Props ocean90.

Merges [44231] into trunk.

See #45547.
Built from https://develop.svn.wordpress.org/trunk@44314


git-svn-id: http://core.svn.wordpress.org/trunk@44144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2018-12-19 03:31:29 +00:00
parent 4aa38f2193
commit 75dfa5f7f6
2 changed files with 59 additions and 52 deletions

View File

@ -1921,9 +1921,54 @@ 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
// Packages styles
$fonts_url = '';
/*
* Translators: Use this to specify the proper Google Font name and variants
* to load that is supported by your language. Do not translate.
* Set to 'off' to disable loading.
*/
$font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
if ( 'off' !== $font_family ) {
$fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
}
$styles->add( 'wp-editor-font', $fonts_url );
$styles->add( 'wp-block-library-theme', "/wp-includes/css/dist/block-library/theme$suffix.css" );
$styles->add(
'wp-edit-blocks',
"/wp-includes/css/dist/block-library/editor$suffix.css",
array(
'wp-components',
'wp-editor',
'wp-block-library',
// Always include visual styles so the editor never appears broken.
'wp-block-library-theme',
)
);
$package_styles = array(
'block-library' => array(),
'components' => array(),
'edit-post' => array( 'wp-components', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
'editor' => array( 'wp-components', 'wp-editor-font', 'wp-nux' ),
'format-library' => array(),
'list-reusable-blocks' => array( 'wp-components' ),
'nux' => array( 'wp-components' ),
);
foreach ( $package_styles as $package => $dependencies ) {
$handle = 'wp-' . $package;
$path = "/wp-includes/css/dist/$package/style$suffix.css";
$styles->add( $handle, $path, $dependencies );
}
// RTL CSS
$rtl_styles = array(
// wp-admin
// Admin CSS
'common',
'forms',
'admin-menu',
@ -1946,7 +1991,7 @@ function wp_default_styles( &$styles ) {
'customize-preview',
'ie',
'login',
// wp-includes
// Includes CSS
'buttons',
'admin-bar',
'wp-auth-check',
@ -1954,7 +1999,17 @@ function wp_default_styles( &$styles ) {
'media-views',
'wp-pointer',
'wp-jquery-ui-dialog',
// deprecated
// 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',
);
@ -1965,54 +2020,6 @@ function wp_default_styles( &$styles ) {
$styles->add_data( $rtl_style, 'suffix', $suffix );
}
}
// Packages styles
$fonts_url = '';
/*
* Translators: Use this to specify the proper Google Font name and variants
* to load that is supported by your language. Do not translate.
* Set to 'off' to disable loading.
*/
$font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
if ( 'off' !== $font_family ) {
$fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
}
$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',
"/wp-includes/css/dist/block-library/editor$suffix.css",
array(
'wp-components',
'wp-editor',
'wp-block-library',
// Always include visual styles so the editor never appears broken.
'wp-block-library-theme',
)
);
$styles->add_data( 'wp-edit-blocks', 'rtl', 'replace' );
$package_styles = array(
'block-library' => array(),
'components' => array(),
'edit-post' => array( 'wp-components', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
'editor' => array( 'wp-components', 'wp-editor-font', 'wp-nux' ),
'format-library' => array(),
'list-reusable-blocks' => array( 'wp-components' ),
'nux' => array( 'wp-components' ),
);
foreach ( $package_styles as $package => $dependencies ) {
$handle = 'wp-' . $package;
$path = "/wp-includes/css/dist/$package/style$suffix.css";
$styles->add( $handle, $path, $dependencies );
$styles->add_data( $handle, 'rtl', 'replace' );
}
}
/**

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-alpha-44313';
$wp_version = '5.1-alpha-44314';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.