Skip to content

Commit 759f2b3

Browse files
hellofromTonyahellofromTonya
authored andcommitted
Editor: Revert [54159].
Reverting changeset due to failing PHPUnit tests. Tests pass without changeset [54156], but fail with it. Reverting to explore why in the original PR after rebasing. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54160 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 34aeac1 commit 759f2b3

9 files changed

Lines changed: 92 additions & 1167 deletions

File tree

src/wp-includes/block-editor.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ function get_default_block_editor_settings() {
209209
'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),
210210
'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ),
211211
'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ),
212-
'disableLayoutStyles' => get_theme_support( 'disable-layout-styles' ),
213212
'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ),
214213
'enableCustomSpacing' => get_theme_support( 'custom-spacing' ),
215214
'enableCustomUnits' => get_theme_support( 'custom-units' ),
@@ -418,18 +417,6 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
418417
$block_classes['css'] = $actual_css;
419418
$global_styles[] = $block_classes;
420419
}
421-
} else {
422-
// If there is no `theme.json` file, ensure base layout styles are still available.
423-
$block_classes = array(
424-
'css' => 'base-layout-styles',
425-
'__unstableType' => 'base-layout',
426-
'isGlobalStyles' => true,
427-
);
428-
$actual_css = wp_get_global_stylesheet( array( $block_classes['css'] ) );
429-
if ( '' !== $actual_css ) {
430-
$block_classes['css'] = $actual_css;
431-
$global_styles[] = $block_classes;
432-
}
433420
}
434421

435422
$editor_settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );
@@ -487,23 +474,9 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
487474
$editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['padding'];
488475
unset( $editor_settings['__experimentalFeatures']['spacing']['padding'] );
489476
}
490-
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customSpacingSize'] ) ) {
491-
$editor_settings['disableCustomSpacingSizes'] = ! $editor_ettings['__experimentalFeatures']['spacing']['customSpacingSize'];
492-
unset( $editor_settings['__experimentalFeatures']['spacing']['customSpacingSize'] );
493-
}
494-
if ( isset( $editor_settings['__experimentalFeatures']['spacing']['spacingSizes'] ) ) {
495-
$spacing_sizes_by_origin = $editor_settings['__experimentalFeatures']['spacing']['spacingSizes'];
496-
$editor_settings['spacingSizes'] = isset( $spacing_sizes_by_origin['custom'] ) ?
497-
$spacing_sizes_by_origin['custom'] : (
498-
isset( $spacing_sizes_by_origin['theme'] ) ?
499-
$spacing_sizes_by_origin['theme'] :
500-
$spacing_sizes_by_origin['default']
501-
);
502-
}
503477

504478
$editor_settings['__unstableResolvedAssets'] = _wp_get_iframed_editor_assets();
505479
$editor_settings['localAutosaveInterval'] = 15;
506-
$editor_settings['disableLayoutStyles'] = current_theme_supports( 'disable-layout-styles' );
507480
$editor_settings['__experimentalDiscussionSettings'] = array(
508481
'commentOrder' => get_option( 'comment_order' ),
509482
'commentsPerPage' => get_option( 'comments_per_page' ),

src/wp-includes/class-wp-theme-json-resolver.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -232,54 +232,6 @@ public static function get_theme_data( $deprecated = array(), $options = array()
232232
return $with_theme_supports;
233233
}
234234

235-
/**
236-
* Gets the styles for blocks from the block.json file.
237-
*
238-
* @since 6.1.0
239-
*
240-
* @return WP_Theme_JSON
241-
*/
242-
public static function get_block_data() {
243-
$registry = WP_Block_Type_Registry::get_instance();
244-
$blocks = $registry->get_all_registered();
245-
$config = array( 'version' => 1 );
246-
foreach ( $blocks as $block_name => $block_type ) {
247-
if ( isset( $block_type->supports['__experimentalStyle'] ) ) {
248-
$config['styles']['blocks'][ $block_name ] = static::remove_json_comments( $block_type->supports['__experimentalStyle'] );
249-
}
250-
251-
if (
252-
isset( $block_type->supports['spacing']['blockGap']['__experimentalDefault'] ) &&
253-
null === _wp_array_get( $config, array( 'styles', 'blocks', $block_name, 'spacing', 'blockGap' ), null )
254-
) {
255-
// Ensure an empty placeholder value exists for the block, if it provides a default blockGap value.
256-
// The real blockGap value to be used will be determined when the styles are rendered for output.
257-
$config['styles']['blocks'][ $block_name ]['spacing']['blockGap'] = null;
258-
}
259-
}
260-
261-
// Core here means it's the lower level part of the styles chain.
262-
// It can be a core or a third-party block.
263-
return new WP_Theme_JSON( $config, 'core' );
264-
}
265-
266-
/**
267-
* When given an array, this will remove any keys with the name `//`.
268-
*
269-
* @param array $array The array to filter.
270-
* @return array The filtered array.
271-
*/
272-
private static function remove_json_comments( $array ) {
273-
unset( $array['//'] );
274-
foreach ( $array as $k => $v ) {
275-
if ( is_array( $v ) ) {
276-
$array[ $k ] = static::remove_json_comments( $v );
277-
}
278-
}
279-
280-
return $array;
281-
}
282-
283235
/**
284236
* Returns the custom post type that contains the user's origin config
285237
* for the active theme or a void array if none are found.
@@ -418,7 +370,6 @@ public static function get_user_data() {
418370
* @since 5.8.0
419371
* @since 5.9.0 Added user data, removed the `$settings` parameter,
420372
* added the `$origin` parameter.
421-
* @since 6.1.0 Added block data.
422373
*
423374
* @param string $origin Optional. To what level should we merge data.
424375
* Valid values are 'theme' or 'custom'. Default 'custom'.
@@ -431,7 +382,6 @@ public static function get_merged_data( $origin = 'custom' ) {
431382

432383
$result = new WP_Theme_JSON();
433384
$result->merge( static::get_core_data() );
434-
$result->merge( static::get_block_data() );
435385
$result->merge( static::get_theme_data() );
436386

437387
if ( 'custom' === $origin ) {

0 commit comments

Comments
 (0)