Changeset 52054
- Timestamp:
- 11/08/2021 09:44:12 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/load-styles.php
r51056 r52054 19 19 require ABSPATH . WPINC . '/theme.php'; 20 20 require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php'; 21 require ABSPATH . WPINC . '/global-styles-and-settings.php'; 21 22 require ABSPATH . WPINC . '/script-loader.php'; 22 23 require ABSPATH . WPINC . '/version.php'; -
trunk/src/wp-includes/block-editor.php
r52049 r52054 304 304 ); 305 305 306 $theme_json = WP_Theme_JSON_Resolver::get_merged_data(); 306 $presets = array( 307 array( 308 'css' => 'variables', 309 '__unstableType' => 'presets', 310 '__experimentalNoWrapper' => true, 311 ), 312 array( 313 'css' => 'presets', 314 '__unstableType' => 'presets', 315 ), 316 ); 317 foreach ( $presets as $preset_style ) { 318 $actual_css = wp_get_global_stylesheet( array( $preset_style['css'] ) ); 319 if ( '' !== $actual_css ) { 320 $preset_style['css'] = $actual_css; 321 $editor_settings['styles'][] = $preset_style; 322 } 323 } 307 324 308 325 if ( WP_Theme_JSON_Resolver::theme_has_support() ) { 309 $ editor_settings['styles'][]= array(310 'css' => $theme_json->get_stylesheet( array( 'styles', 'presets' ) ),311 '__unstableType' => ' globalStyles',326 $block_classes = array( 327 'css' => 'styles', 328 '__unstableType' => 'theme', 312 329 ); 313 $ editor_settings['styles'][] = array(314 'css' => $theme_json->get_stylesheet( array( 'variables' ) ),315 '__experimentalNoWrapper' => true,316 '__unstableType' => 'globalStyles',317 );318 } 319 320 $editor_settings['__experimentalFeatures'] = $theme_json->get_settings();330 $actual_css = wp_get_global_stylesheet( array( $block_classes['css'] ) ); 331 if ( '' !== $actual_css ) { 332 $block_classes['css'] = $actual_css; 333 $editor_settings['styles'][] = $block_classes; 334 } 335 } 336 337 $editor_settings['__experimentalFeatures'] = wp_get_global_settings(); 321 338 // These settings may need to be updated based on data coming from theme.json sources. 322 339 if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { -
trunk/src/wp-includes/script-loader.php
r52049 r52054 2304 2304 } 2305 2305 2306 $can_use_cache = ( 2307 ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && 2308 ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && 2309 ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && 2310 ! is_admin() 2311 ); 2312 2313 $stylesheet = null; 2314 $transient_name = 'global_styles_' . get_stylesheet(); 2315 2316 if ( $can_use_cache ) { 2317 $cache = get_transient( $transient_name ); 2318 if ( $cache ) { 2319 $stylesheet = $cache; 2320 } 2321 } 2322 2323 if ( null === $stylesheet ) { 2324 $theme_json = WP_Theme_JSON_Resolver::get_merged_data(); 2325 $stylesheet = $theme_json->get_stylesheet(); 2326 2327 if ( $can_use_cache ) { 2328 set_transient( $transient_name, $stylesheet, MINUTE_IN_SECONDS ); 2329 } 2330 } 2306 $stylesheet = wp_get_global_stylesheet(); 2331 2307 2332 2308 if ( empty( $stylesheet ) ) { -
trunk/src/wp-settings.php
r52051 r52054 174 174 require ABSPATH . WPINC . '/class-wp-theme-json.php'; 175 175 require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php'; 176 require ABSPATH . WPINC . '/global-styles-and-settings.php'; 176 177 require ABSPATH . WPINC . '/class-wp-block-template.php'; 177 178 require ABSPATH . WPINC . '/block-template-utils.php';
Note: See TracChangeset
for help on using the changeset viewer.