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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user