1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 21:56:33 +02:00

feat(shortcodes): upd php shortcode

This commit is contained in:
Awilum
2022-05-09 17:00:58 +03:00
parent 8290971a95
commit ea1c910218

View File

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