On this page
wp_enqueue_classic_theme_styles()
Loads classic theme styles on classic themes in the frontend.
Description
This is needed for backwards compatibility for button blocks specifically.
Source
File: wp-includes/script-loader.php. View all references
function wp_enqueue_classic_theme_styles() {
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$suffix = wp_scripts_get_suffix();
wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css", array(), true );
wp_enqueue_style( 'classic-theme-styles' );
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Theme_JSON_Resolver::theme_has_support() wp-includes/class-wp-theme-json-resolver.php | Determines whether the active theme has a theme.json file. |
| wp_scripts_get_suffix() wp-includes/script-loader.php | Returns the suffix that can be used for the scripts. |
| wp_register_style() wp-includes/functions.wp-styles.php | Register a CSS stylesheet. |
| wp_enqueue_style() wp-includes/functions.wp-styles.php | Enqueue a CSS stylesheet. |
Changelog
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_enqueue_classic_theme_styles