Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed May 31, 2024
1 parent cfadbb4 commit 3598752
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,11 @@ private static function recursively_iterate_json( $dir ) {
*/
private static function style_variation_has_scope( $variation, $scope ) {
if ( 'block' === $scope ) {
return isset( $variation['blockTypes'] );
return isset( $variation['blockTypes'] );
}

if ( 'theme' === $scope ) {
return ! isset( $variation['blockTypes'] );
return ! isset( $variation['blockTypes'] );
}

return false;
Expand Down
18 changes: 9 additions & 9 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ protected static function sanitize( $input, $valid_block_names, $valid_element_n
* inner `blocks`, the overall schema will be generated in multiple passes.
*/
foreach ( $valid_block_names as $block ) {
$schema_settings_blocks[ $block ] = static::VALID_SETTINGS;
$schema_styles_blocks[ $block ] = $styles_non_top_level;
$schema_styles_blocks[ $block ]['elements'] = $schema_styles_elements;
$schema_settings_blocks[ $block ] = static::VALID_SETTINGS;
$schema_styles_blocks[ $block ] = $styles_non_top_level;
$schema_styles_blocks[ $block ]['elements'] = $schema_styles_elements;
}

$block_style_variation_styles = static::VALID_STYLES;
Expand Down Expand Up @@ -1062,15 +1062,15 @@ protected static function get_blocks_metadata() {
$registered_styles = $style_registry->get_all_registered();
foreach ( static::$blocks_metadata as $block_name => $block_metadata ) {
if ( ! empty( $registered_styles[ $block_name ] ) ) {
$style_selectors = $block_metadata['styleVariations'] ?? array();
$style_selectors = $block_metadata['styleVariations'] ?? array();

foreach ( $registered_styles[ $block_name ] as $block_style ) {
if ( ! isset( $style_selectors[ $block_style['name'] ] ) ) {
$style_selectors[ $block_style['name'] ] = static::get_block_style_variation_selector( $block_style['name'], $block_metadata['selector'] );
$style_selectors[ $block_style['name'] ] = static::get_block_style_variation_selector( $block_style['name'], $block_metadata['selector'] );
}
}

static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
}
}
return static::$blocks_metadata;
Expand Down Expand Up @@ -1117,11 +1117,11 @@ protected static function get_blocks_metadata() {
// Block style variations can be registered through the WP_Block_Styles_Registry as well as block.json.
$registered_styles = $style_registry->get_registered_styles_for_block( $block_name );
foreach ( $registered_styles as $style ) {
$style_selectors[ $style['name'] ] = static::get_block_style_variation_selector( $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
$style_selectors[ $style['name'] ] = static::get_block_style_variation_selector( $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
}

if ( ! empty( $style_selectors ) ) {
static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
}
}

Expand Down Expand Up @@ -3238,7 +3238,7 @@ public static function remove_insecure_properties( $theme_json ) {
// Process a variation's elements and element pseudo selector styles.
if ( isset( $variation_input['elements'] ) ) {
foreach ( $valid_element_names as $element_name ) {
$element_input = $variation_input['elements'][ $element_name ] ?? null;
$element_input = $variation_input['elements'][ $element_name ] ?? null;
if ( $element_input ) {
$element_output = static::remove_insecure_styles( $element_input );

Expand Down

0 comments on commit 3598752

Please sign in to comment.