Changeset 50959
- Timestamp:
- 05/24/2021 08:36:11 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 14 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-editor.php
r50956 r50959 244 244 ); 245 245 246 $editor_settings['__experimentalFeatures'] = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings )->get_settings(); 247 248 // These settings may need to be updated based on data coming from theme.json sources. 249 if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { 250 $editor_settings['colors'] = $editor_settings['__experimentalFeatures']['color']['palette']; 251 unset( $editor_settings['__experimentalFeatures']['color']['palette'] ); 252 } 253 if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { 254 $editor_settings['gradients'] = $editor_settings['__experimentalFeatures']['color']['gradients']; 255 unset( $editor_settings['__experimentalFeatures']['color']['gradients'] ); 256 } 257 if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { 258 $editor_settings['disableCustomColors'] = $editor_settings['__experimentalFeatures']['color']['custom']; 259 unset( $editor_settings['__experimentalFeatures']['color']['custom'] ); 260 } 261 if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) { 262 $editor_settings['disableCustomGradients'] = $editor_settings['__experimentalFeatures']['color']['customGradient']; 263 unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ); 264 } 265 if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { 266 $editor_settings['fontSizes'] = $editor_settings['__experimentalFeatures']['typography']['fontSizes']; 267 unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ); 268 } 269 if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) { 270 $editor_settings['disableCustomFontSizes'] = $editor_settings['__experimentalFeatures']['typography']['customFontSize']; 271 unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ); 272 } 273 if ( isset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ) ) { 274 $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['customLineHeight']; 275 unset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ); 276 } 277 if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { 278 if ( ! is_array( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { 279 $editor_settings['enableCustomUnits'] = false; 280 } else { 281 $editor_settings['enableCustomUnits'] = count( $editor_settings['__experimentalFeatures']['spacing']['units'] ) > 0; 282 } 283 unset( $editor_settings['__experimentalFeatures']['spacing']['units'] ); 284 } 285 if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ) ) { 286 $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['customPadding']; 287 unset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ); 288 } 289 246 290 /** 247 291 * Filters the settings to pass to the block editor for all editor type. -
trunk/src/wp-settings.php
r50956 r50959 296 296 require ABSPATH . WPINC . '/blocks.php'; 297 297 require ABSPATH . WPINC . '/blocks/index.php'; 298 require ABSPATH . WPINC . '/class-wp-theme-json.php'; 299 require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php'; 298 300 require ABSPATH . WPINC . '/block-editor.php'; 299 301 require ABSPATH . WPINC . '/block-patterns.php';
Note: See TracChangeset
for help on using the changeset viewer.