Skip to content

Commit bd88a01

Browse files
authored
Merge branch 'develop' into feat/block-wrap-attributes
2 parents b38cc73 + ff7a255 commit bd88a01

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
## [Next]
55

66
* [Added] Render block wrapper attributes
7+
* [Added] Support for block spacing
78

89
## 1.0.6
910

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Block template file needs to have a comment header containing block parameters.
9999
* Supports Mode: (true|false, ACF only)
100100
* Supports Multiple: (true|false)
101101
* Supports Reusable: (true|false)
102+
* Supports Spacing: (true)
102103
*/
103104
```
104105

src/BlockLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function init( $config = [] ) {
5959
'supports_mode' => 'Supports Mode',
6060
'supports_multiple' => 'Supports Multiple',
6161
'supports_reusable' => 'Supports Reusable',
62+
'supports_spacing' => 'Supports Spacing',
6263
];
6364

6465
/**
@@ -259,6 +260,8 @@ public function get_block_data( $file ) {
259260
foreach ( $data as $key => &$value ) {
260261
if ( in_array( $key, [ 'keywords', 'post_types', 'supports_align' ], true ) ) {
261262
$value = $this->parse_coma_separated_list( $value );
263+
} elseif ( 'supports_spacing' === $key && 'true' === $value ) {
264+
$value = [ 'margin' => true, 'padding' => true ];
262265
} elseif ( in_array( $value, [ 'true', 'false' ], true ) ) {
263266
$value = ( 'true' === $value ) ? true : false;
264267
}

0 commit comments

Comments
 (0)