From 158b5a7c1e269ee02245889b9d94fb0953341125 Mon Sep 17 00:00:00 2001 From: Max Baan Date: Fri, 27 Aug 2021 14:08:21 +0200 Subject: [PATCH 1/2] Refactored the @field function to accept 'option' as second argument --- src/Directives/ACF.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directives/ACF.php b/src/Directives/ACF.php index ed3100b..17f5eea 100644 --- a/src/Directives/ACF.php +++ b/src/Directives/ACF.php @@ -65,7 +65,7 @@ return "get(0)}, {$expression->get(2)})[{$expression->get(1)}]; ?>"; } - if (! is_string($expression->get(1))) { + if (! is_string($expression->get(1)) || $expression->get(1) == 'option') { return "get(0)}, {$expression->get(1)}); ?>"; } From 7be8e2c4aba0cf459b3dc0b8c59920113bc3eca7 Mon Sep 17 00:00:00 2001 From: Max Baan Date: Fri, 27 Aug 2021 15:02:18 +0200 Subject: [PATCH 2/2] Added the strip util to the statement to make it work --- src/Directives/ACF.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directives/ACF.php b/src/Directives/ACF.php index 17f5eea..232cbc1 100644 --- a/src/Directives/ACF.php +++ b/src/Directives/ACF.php @@ -65,7 +65,7 @@ return "get(0)}, {$expression->get(2)})[{$expression->get(1)}]; ?>"; } - if (! is_string($expression->get(1)) || $expression->get(1) == 'option') { + if (! is_string($expression->get(1)) || Util::strip($expression->get(1)) == "option") { return "get(0)}, {$expression->get(1)}); ?>"; }