wp_enqueue_classic_theme_styles

The timeline below displays how wordpress function wp_enqueue_classic_theme_styles has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Loads classic theme styles on classic themes in the frontend.
 *
 * This is needed for backwards compatibility for button blocks specifically.
 *
 * @since 6.1.0
 */
function wp_enqueue_classic_theme_styles()
{
    if (!wp_theme_has_theme_json()) {
        $suffix = wp_scripts_get_suffix();
        wp_register_style('classic-theme-styles', '/' . WPINC . "/css/classic-themes{$suffix}.css");
        wp_style_add_data('classic-theme-styles', 'path', ABSPATH . WPINC . "/css/classic-themes{$suffix}.css");
        wp_enqueue_style('classic-theme-styles');
    }
}

WordPress Version: 6.2

/**
 * Loads classic theme styles on classic themes in the frontend.
 *
 * This is needed for backwards compatibility for button blocks specifically.
 *
 * @since 6.1.0
 */
function wp_enqueue_classic_theme_styles()
{
    if (!wp_theme_has_theme_json()) {
        $suffix = wp_scripts_get_suffix();
        wp_register_style('classic-theme-styles', '/' . WPINC . "/css/classic-themes{$suffix}.css");
        wp_enqueue_style('classic-theme-styles');
    }
}

WordPress Version: 6.1

/**
 * Loads classic theme styles on classic themes in the frontend.
 *
 * This is needed for backwards compatibility for button blocks specifically.
 *
 * @since 6.1.0
 */
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');
    }
}