Skip to content

Commit

Permalink
feat(resolve config): use hashtag to reuse same copnt multiple times …
Browse files Browse the repository at this point in the history
…in same layout
  • Loading branch information
maxduyck committed Dec 19, 2016
1 parent 1f8376e commit d27c63b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ACFComposer/ResolveConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d27c63b

Please sign in to comment.