From a4ca0d62e037d9fe18cbdcdbfaba2607c8c36169 Mon Sep 17 00:00:00 2001 From: Maciej Palmowski Date: Sun, 21 Jun 2020 15:42:32 +0200 Subject: [PATCH] Added support for ExperimanetalJSX --- docs/parameters.md | 1 + timber-acf-wp-blocks.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/parameters.md b/docs/parameters.md index 14b922c..0599c5e 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -18,6 +18,7 @@ SupportsMode: (true|false) SupportsMultiple: (true|false) SupportsReusable: (true|false) + SupportsJSX: (true|false) Example: (JSON format) #} ``` diff --git a/timber-acf-wp-blocks.php b/timber-acf-wp-blocks.php index 01241af..480b996 100644 --- a/timber-acf-wp-blocks.php +++ b/timber-acf-wp-blocks.php @@ -67,6 +67,7 @@ function () { 'supports_custom_class_name' => 'SupportsCustomClassName', 'supports_reusable' => 'SupportsReusable', 'example' => 'Example', + 'supports_jsx' => 'SupportsJSX', ) ); @@ -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();