Skip to content

Commit

Permalink
Add comment clarifying early return
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Jan 27, 2023
1 parent 3d7891d commit ea0ea2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,8 @@ protected function get_layout_styles( $block_metadata ) {
return $block_rules;
}

// Skip outputting layout styles if the block does not support layout or margin.
// For blocks that have margin but not layout support, only layout aware margin styles are output.
if ( isset( $block_metadata['name'] ) ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_metadata['name'] );
if (
Expand Down

0 comments on commit ea0ea2f

Please sign in to comment.