Changeset 51149 for trunk/src/wp-includes/block-editor.php
- Timestamp:
- 06/15/2021 08:50:26 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-editor.php
r51090 r51149 226 226 } 227 227 228 return $editor_settings; 229 } 230 231 /** 232 * Returns the block editor settings needed to use the Legacy Widget block which 233 * is not registered by default. 234 * 235 * @since 5.8.0 236 * 237 * @return array Settings to be used with get_block_editor_settings(). 238 */ 239 function get_legacy_widget_block_editor_settings() { 240 $editor_settings = array(); 241 228 242 /** 229 243 * Filters the list of widget-type IDs that should **not** be offered by the … … 297 311 $editor_settings['__experimentalFeatures'] = $theme_json->get_settings(); 298 312 // These settings may need to be updated based on data coming from theme.json sources. 299 if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { 300 $editor_settings['colors'] = $editor_settings['__experimentalFeatures']['color']['palette']; 301 unset( $editor_settings['__experimentalFeatures']['color']['palette'] ); 302 } 303 if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { 304 $editor_settings['gradients'] = $editor_settings['__experimentalFeatures']['color']['gradients']; 305 unset( $editor_settings['__experimentalFeatures']['color']['gradients'] ); 313 if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) { 314 $colors_by_origin = $settings['__experimentalFeatures']['color']['palette']; 315 $settings['colors'] = isset( $colors_by_origin['user'] ) ? 316 $colors_by_origin['user'] : ( 317 isset( $colors_by_origin['theme'] ) ? 318 $colors_by_origin['theme'] : 319 $colors_by_origin['core'] 320 ); 321 } 322 if ( isset( $settings['__experimentalFeatures']['color']['gradients'] ) ) { 323 $gradients_by_origin = $settings['__experimentalFeatures']['color']['gradients']; 324 $settings['gradients'] = isset( $gradients_by_origin['user'] ) ? 325 $gradients_by_origin['user'] : ( 326 isset( $gradients_by_origin['theme'] ) ? 327 $gradients_by_origin['theme'] : 328 $gradients_by_origin['core'] 329 ); 330 } 331 if ( isset( $settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { 332 $font_sizes_by_origin = $settings['__experimentalFeatures']['typography']['fontSizes']; 333 $settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ? 334 $font_sizes_by_origin['user'] : ( 335 isset( $font_sizes_by_origin['theme'] ) ? 336 $font_sizes_by_origin['theme'] : 337 $font_sizes_by_origin['core'] 338 ); 306 339 } 307 340 if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { … … 312 345 $editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient']; 313 346 unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ); 314 }315 if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {316 $editor_settings['fontSizes'] = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];317 unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] );318 347 } 319 348 if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.