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. git-svn-id: https://develop.svn.wordpress.org/trunk@44314 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
156a01e8fb
commit
3c836e3181
@ -1921,9 +1921,54 @@ function wp_default_styles( &$styles ) {
|
|||||||
$styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle.
|
$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
|
$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 CSS
|
||||||
$rtl_styles = array(
|
$rtl_styles = array(
|
||||||
// wp-admin
|
// Admin CSS
|
||||||
'common',
|
'common',
|
||||||
'forms',
|
'forms',
|
||||||
'admin-menu',
|
'admin-menu',
|
||||||
@ -1946,7 +1991,7 @@ function wp_default_styles( &$styles ) {
|
|||||||
'customize-preview',
|
'customize-preview',
|
||||||
'ie',
|
'ie',
|
||||||
'login',
|
'login',
|
||||||
// wp-includes
|
// Includes CSS
|
||||||
'buttons',
|
'buttons',
|
||||||
'admin-bar',
|
'admin-bar',
|
||||||
'wp-auth-check',
|
'wp-auth-check',
|
||||||
@ -1954,7 +1999,17 @@ function wp_default_styles( &$styles ) {
|
|||||||
'media-views',
|
'media-views',
|
||||||
'wp-pointer',
|
'wp-pointer',
|
||||||
'wp-jquery-ui-dialog',
|
'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',
|
'deprecated-media',
|
||||||
'farbtastic',
|
'farbtastic',
|
||||||
);
|
);
|
||||||
@ -1965,54 +2020,6 @@ function wp_default_styles( &$styles ) {
|
|||||||
$styles->add_data( $rtl_style, 'suffix', $suffix );
|
$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' );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user