1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

feat(directives): update logic for shortcodes directive

This commit is contained in:
Awilum
2022-05-08 21:26:40 +03:00
parent ce163f761b
commit ee9520eb7c

View File

@@ -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);