Make WordPress Core


Ignore:
Timestamp:
03/13/2025 10:58:25 PM (13 months ago)
Author:
audrasjb
Message:

Themes: Enqueue classic-theme-styles in enqueue_block_assets.

[54687] introduced a fallback stylesheet for Button block styles (and later File blocks) for both the front end and the editor. In the editor, that has been added within the body, after the theme's block styles. That commit had quick fixes for Twenty Twelve and Twenty Twenty, but raising the specificity for those colors should have been unnecessary. Also, themes such as Twenty Fourteen — and non-bundled themes — still have had a similar problem with the incorrect order.

Thus, this changeset:

  • Registers the stylesheet outside wp_enqueue_classic_theme_styles().
  • Enqueues classic styles in the enqueue_block_assets action instead of adding them in the block_editor_settings_all filter.
  • Deprecates the wp_add_editor_classic_theme_styles() function.

Follow-up to [54687].

Props sabernhardt, mukesh27.
Fixes #61892.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r59968 r59980  
    589589add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
    590590add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
     591add_action( 'enqueue_block_assets', 'wp_enqueue_classic_theme_styles' );
    591592add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
    592593add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
     
    613614add_action( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
    614615add_action( 'admin_head', 'wp_check_widget_editor_deps' );
    615 add_filter( 'block_editor_settings_all', 'wp_add_editor_classic_theme_styles' );
    616616
    617617// Global styles can be enqueued in both the header and the footer. See https://core.trac.wordpress.org/ticket/53494.
Note: See TracChangeset for help on using the changeset viewer.