From d27c63b0e6affbf2b0c59f6f7cebd7bbddec4224 Mon Sep 17 00:00:00 2001 From: bleechmaxime Date: Mon, 19 Dec 2016 10:31:18 +0100 Subject: [PATCH] feat(resolve config): use hashtag to reuse same copnt multiple times in same layout --- lib/ACFComposer/ResolveConfig.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ACFComposer/ResolveConfig.php b/lib/ACFComposer/ResolveConfig.php index c476026..27e0ab8 100644 --- a/lib/ACFComposer/ResolveConfig.php +++ b/lib/ACFComposer/ResolveConfig.php @@ -40,7 +40,13 @@ public static function forLayout($config, $parentKeys = []) { protected static function forEntity($config, $requiredAttributes, $parentKeys = []) { if (is_string($config)) { $filterName = $config; - $config = apply_filters($filterName, null); + $filterParts = explode('#', $filterName); + if (isset($filterParts[1])) { + $config = apply_filters($filterParts[0], null, $filterParts[1]); + } else { + $config = apply_filters($filterName, null); + } + if (is_null($config)) { trigger_error("ACFComposer: Filter {$filterName} does not exist!", E_USER_WARNING);