Changeset 59980 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 03/13/2025 10:58:25 PM (11 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/script-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r59896 r59980 1663 1663 $styles->add_data( 'wp-block-library-theme', 'path', ABSPATH . $block_library_theme_path ); 1664 1664 1665 $classic_theme_styles_path = WPINC . "/css/classic-themes$suffix.css"; 1666 $styles->add( 'classic-theme-styles', "/$classic_theme_styles_path" ); 1667 $styles->add_data( 'classic-theme-styles', 'path', ABSPATH . $classic_theme_styles_path ); 1668 1665 1669 $styles->add( 1666 1670 'wp-reset-editor-styles', … … 3352 3356 * Loads classic theme styles on classic themes in the frontend. 3353 3357 * 3354 * This is needed for backwards compatibility for buttonblocks specifically.3358 * This is used for backwards compatibility for Button and File blocks specifically. 3355 3359 * 3356 3360 * @since 6.1.0 3361 * @since 6.2.0 Added File block styles. 3362 * @since 6.8.0 Moved stylesheet registration outside of this function. 3357 3363 */ 3358 3364 function wp_enqueue_classic_theme_styles() { 3359 3365 if ( ! wp_theme_has_theme_json() ) { 3360 $suffix = wp_scripts_get_suffix();3361 wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css" );3362 wp_style_add_data( 'classic-theme-styles', 'path', ABSPATH . WPINC . "/css/classic-themes$suffix.css" );3363 3366 wp_enqueue_style( 'classic-theme-styles' ); 3364 3367 } 3365 }3366 3367 /**3368 * Loads classic theme styles on classic themes in the editor.3369 *3370 * This is needed for backwards compatibility for button blocks specifically.3371 *3372 * @since 6.1.03373 *3374 * @param array $editor_settings The array of editor settings.3375 * @return array A filtered array of editor settings.3376 */3377 function wp_add_editor_classic_theme_styles( $editor_settings ) {3378 if ( wp_theme_has_theme_json() ) {3379 return $editor_settings;3380 }3381 3382 $suffix = wp_scripts_get_suffix();3383 $classic_theme_styles = ABSPATH . WPINC . "/css/classic-themes$suffix.css";3384 3385 /*3386 * This follows the pattern of get_block_editor_theme_styles,3387 * but we can't use get_block_editor_theme_styles directly as it3388 * only handles external files or theme files.3389 */3390 $classic_theme_styles_settings = array(3391 'css' => file_get_contents( $classic_theme_styles ),3392 '__unstableType' => 'core',3393 'isGlobalStyles' => false,3394 );3395 3396 // Add these settings to the start of the array so that themes can override them.3397 array_unshift( $editor_settings['styles'], $classic_theme_styles_settings );3398 3399 return $editor_settings;3400 3368 } 3401 3369
Note: See TracChangeset
for help on using the changeset viewer.