mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 11:44:33 +00:00
Editor: Fix 'wp-block-library-theme' style enqueue conditions.
Fixes the conditions for when to enqueue the opinionated block styles (i.e. `'wp-block-library-theme'` stylesheet): * the theme adds `'wp-block-styles'` theme support; * and no editor styles are declared. This resolves an issue with themes that do not add the `'wp-block-styles'` theme support while not impacting themes that do. Follow-up to [53419], [52069], [50761], [44157]. Props mikachan, costdev, glendaviesnz, hellofromTonya, jffng, mamaduka, ndiego, poena, sannevndrmeulen, scruffian. Fixes #57561. git-svn-id: https://develop.svn.wordpress.org/trunk@55368 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -296,7 +296,7 @@ function get_legacy_widget_block_editor_settings() {
|
||||
* }
|
||||
*/
|
||||
function _wp_get_iframed_editor_assets() {
|
||||
global $pagenow;
|
||||
global $pagenow, $editor_styles;
|
||||
|
||||
$script_handles = array(
|
||||
'wp-polyfill',
|
||||
@@ -305,7 +305,10 @@ function _wp_get_iframed_editor_assets() {
|
||||
'wp-edit-blocks',
|
||||
);
|
||||
|
||||
if ( current_theme_supports( 'wp-block-styles' ) ) {
|
||||
if (
|
||||
current_theme_supports( 'wp-block-styles' ) &&
|
||||
( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 )
|
||||
) {
|
||||
$style_handles[] = 'wp-block-library-theme';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user