Make WordPress Core


Ignore:
Timestamp:
09/29/2022 06:53:57 PM (2 years ago)
Author:
davidbaumwald
Message:

Editor: Reintroduce styles that were removed for classic themes.

After block CSS was merged with theme.json styles in Gutenberg PR #34180, this removed some existing, default styling for some elements, including buttons. This change re-adds the removed styles by enqueueing classic.css for classic themes.

Merges Gutenberg PR #44334 into trunk.

Follow-up to [54257].

Props scruffian, oandregal, ramonopoly, aristath, andrewserong, get_dave, bernhard-reiter.
See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r54354 r54358  
    36413641    add_action( 'admin_init', $fn_generate_and_enqueue_editor_styles );
    36423642}
     3643
     3644/**
     3645 * Loads classic theme styles on classic themes.
     3646 *
     3647 * This is needed for backwards compatibility for button blocks specifically.
     3648 */
     3649function wp_enqueue_classic_theme_styles() {
     3650    if ( ! wp_is_block_theme() ) {
     3651        $suffix = wp_scripts_get_suffix();
     3652        wp_register_style( 'classic-theme-styles', "/wp-includes/css/dist/block-library/classic$suffix.css", array(), true );
     3653        wp_enqueue_style( 'classic-theme-styles' );
     3654    }
     3655}
Note: See TracChangeset for help on using the changeset viewer.