mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 06:06:45 +02:00
feat(entries): update settings #552
This commit is contained in:
@@ -11,9 +11,9 @@ namespace Flextype\Support\Parsers\Shortcodes;
|
||||
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
|
||||
// Shortcode: [entries_fetch id="entry-id" field="field-name" default="default-value"]
|
||||
if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.entries.enabled')) {
|
||||
flextype('parsers')->shortcode()->addHandler('entries_fetch', static function (ShortcodeInterface $s) {
|
||||
return arrays(flextype('entries')->fetch($s->getParameter('id')))->get($s->getParameter('field'), $s->getParameter('default'));
|
||||
// Shortcode: [content_fetch id="entry-id" field="field-name" default="default-value"]
|
||||
if (flextype('registry')->get('flextype.settings.parsers.shortcode.shortcodes.content.enabled')) {
|
||||
flextype('parsers')->shortcode()->addHandler('content_fetch', static function (ShortcodeInterface $s) {
|
||||
return arrays(flextype('content')->fetch($s->getParameter('id')))->get($s->getParameter('field'), $s->getParameter('default'));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user