From 3874c619edb63e58f3e3bfe17bbb364fa25c7a3a Mon Sep 17 00:00:00 2001 From: Maciej Palmowski Date: Tue, 6 Oct 2020 13:46:22 +0200 Subject: [PATCH] Adds support for parent parameter --- docs/parameters.md | 1 + timber-acf-wp-blocks.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/parameters.md b/docs/parameters.md index 2d2cd8e..0d2a03f 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -20,5 +20,6 @@ SupportsReusable: (true|false) SupportsJSX: (true|false) Example: (JSON format) + Parent: (space-separated) #} ``` diff --git a/timber-acf-wp-blocks.php b/timber-acf-wp-blocks.php index 7add605..127af68 100644 --- a/timber-acf-wp-blocks.php +++ b/timber-acf-wp-blocks.php @@ -70,6 +70,7 @@ function () { 'supports_reusable' => 'SupportsReusable', 'example' => 'Example', 'supports_jsx' => 'SupportsJSX', + 'parent' => 'Parent', ) ); @@ -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 ); }