Skip to content

Commit

Permalink
Merge pull request #34 from palmiak/support-parent-parameter
Browse files Browse the repository at this point in the history
Adds support for parent parameter
  • Loading branch information
palmiak authored Oct 6, 2020
2 parents 56a220c + 3874c61 commit 997d97c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
SupportsReusable: (true|false)
SupportsJSX: (true|false)
Example: (JSON format)
Parent: (space-separated)
#}
```
6 changes: 6 additions & 0 deletions timber-acf-wp-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function () {
'supports_reusable' => 'SupportsReusable',
'example' => 'Example',
'supports_jsx' => 'SupportsJSX',
'parent' => 'Parent',
)
);

Expand Down Expand Up @@ -177,6 +178,11 @@ function () {
);
}

// Support for "parent".
if ( ! empty( $file_headers['parent'] ) ) {
$data['parent'] = str_getcsv( $file_headers['parent'], ' ', '"' );
}

// Register the block with ACF.
acf_register_block_type( $data );
}
Expand Down

0 comments on commit 997d97c

Please sign in to comment.