Changeset 54688 for branches/6.1/src/wp-includes/script-loader.php
- Timestamp:
- 10/25/2022 01:43:49 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1/src/wp-includes/script-loader.php
r54501 r54688 3659 3659 3660 3660 /** 3661 * Loads classic theme styles on classic themes .3661 * Loads classic theme styles on classic themes in the frontend. 3662 3662 * 3663 3663 * This is needed for backwards compatibility for button blocks specifically. … … 3666 3666 */ 3667 3667 function wp_enqueue_classic_theme_styles() { 3668 if ( ! wp_is_block_theme() ) {3668 if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { 3669 3669 $suffix = wp_scripts_get_suffix(); 3670 wp_register_style( 'classic-theme-styles', "/wp-includes/css/dist/block-library/classic$suffix.css", array(), true );3670 wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css", array(), true ); 3671 3671 wp_enqueue_style( 'classic-theme-styles' ); 3672 3672 } 3673 3673 } 3674 3675 /** 3676 * Loads classic theme styles on classic themes in the editor. 3677 * 3678 * This is needed for backwards compatibility for button blocks specifically. 3679 * 3680 * @since 6.1.0 3681 * 3682 * @param array $editor_settings The array of editor settings. 3683 * @return array A filtered array of editor settings. 3684 */ 3685 function wp_add_editor_classic_theme_styles( $editor_settings ) { 3686 if ( WP_Theme_JSON_Resolver::theme_has_support() ) { 3687 return $editor_settings; 3688 } 3689 $suffix = wp_scripts_get_suffix(); 3690 $classic_theme_styles = ABSPATH . WPINC . "/css/classic-themes$suffix.css"; 3691 3692 // This follows the pattern of get_block_editor_theme_styles, 3693 // but we can't use get_block_editor_theme_styles directly as it 3694 // only handles external files or theme files. 3695 $classic_theme_styles_settings = array( 3696 'css' => file_get_contents( $classic_theme_styles ), 3697 '__unstableType' => 'core', 3698 'isGlobalStyles' => false, 3699 ); 3700 3701 // Add these settings to the start of the array so that themes can override them. 3702 array_unshift( $editor_settings['styles'], $classic_theme_styles_settings ); 3703 3704 return $editor_settings; 3705 }
Note: See TracChangeset
for help on using the changeset viewer.