From ee9520eb7c5e81b06a310470a5c01066d8d7ce59 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 8 May 2022 21:26:40 +0300 Subject: [PATCH] feat(directives): update logic for `shortcodes` directive --- src/flextype/core/Entries/Directives/ShortcodesDirective.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/flextype/core/Entries/Directives/ShortcodesDirective.php b/src/flextype/core/Entries/Directives/ShortcodesDirective.php index 65a47a2a..9c33ed70 100644 --- a/src/flextype/core/Entries/Directives/ShortcodesDirective.php +++ b/src/flextype/core/Entries/Directives/ShortcodesDirective.php @@ -24,8 +24,10 @@ emitter()->addListener('onEntriesFetchSingleDirectives', static function (): voi $field = entries()->registry()->get('methods.fetch.field'); - if (strings($field)->contains('@parser:shortcodes') && registry()->get('flextype.settings.entries.parsers.shortcodes.enabled') != false) { + if (strings($field)->contains('@parser:shortcodes')) { $field = strings(parsers()->shortcodes()->parse($field))->replace('@parser:shortcodes', '')->trim()->toString(); + } elseif (registry()->get('flextype.settings.entries.parsers.shortcodes.enabled') !== false) { + $field = parsers()->shortcodes()->parse($field); } entries()->registry()->set('methods.fetch.field', $field);