Skip to content

Commit

Permalink
Added support for ExperimanetalJSX
Browse files Browse the repository at this point in the history
  • Loading branch information
palmiak committed Jun 21, 2020
1 parent 741753e commit a4ca0d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SupportsMode: (true|false)
SupportsMultiple: (true|false)
SupportsReusable: (true|false)
SupportsJSX: (true|false)
Example: (JSON format)
#}
```
7 changes: 6 additions & 1 deletion timber-acf-wp-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function () {
'supports_custom_class_name' => 'SupportsCustomClassName',
'supports_reusable' => 'SupportsReusable',
'example' => 'Example',
'supports_jsx' => 'SupportsJSX',
)
);

Expand Down Expand Up @@ -154,8 +155,12 @@ function () {
$data['enqueue_script'] = $file_headers['enqueue_script'];
}
}
// Support for experimantal JSX.
if ( ! empty( $file_headers['supports_jsx'] ) ) {
$data['supports']['__experimental_jsx'] = 'true' === $file_headers['supports_jsx'] ? true : false;
}

// Suuport for "example".
// Support for "example".
if ( ! empty( $file_headers['example'] ) ) {
$json = json_decode( $file_headers['example'], true );
$example_data = ( null !== $json ) ? $json : array();
Expand Down

0 comments on commit a4ca0d6

Please sign in to comment.