From ea1c910218b9f082263ecba5b384330505a651e0 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 9 May 2022 17:00:58 +0300 Subject: [PATCH] feat(shortcodes): upd `php` shortcode --- src/flextype/core/Parsers/Shortcodes/PhpShortcode.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php b/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php index da329064..5c4e6606 100644 --- a/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php @@ -20,6 +20,10 @@ use Thunder\Shortcode\Shortcode\ShortcodeInterface; // Shortcode: [php] php code here [/php] parsers()->shortcodes()->addHandler('php', static function (ShortcodeInterface $s) { + if (! registry()->get('flextype.settings.parsers.shortcodes.shortcodes.php.enabled')) { + return ''; + } + ob_start(); eval($s->getContent()); return ob_get_clean();