From 4400657e30d68ebd69c63d7716865aef5c5f246e Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 11 Jul 2022 13:44:37 +0300 Subject: [PATCH] feat(shortcodes): add `date` shortcode --- .../core/Parsers/Shortcodes/DateShortcode.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/flextype/core/Parsers/Shortcodes/DateShortcode.php diff --git a/src/flextype/core/Parsers/Shortcodes/DateShortcode.php b/src/flextype/core/Parsers/Shortcodes/DateShortcode.php new file mode 100644 index 00000000..f8df2eba --- /dev/null +++ b/src/flextype/core/Parsers/Shortcodes/DateShortcode.php @@ -0,0 +1,33 @@ +shortcodes()->addHandler('date', static function (ShortcodeInterface $s) { + if (! registry()->get('flextype.settings.parsers.shortcodes.shortcodes.date.enabled')) { + return ''; + } + + return date($s->getBBCode()); +});