diff --git a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php index 340d4e2d..dc97f282 100644 --- a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php @@ -84,6 +84,11 @@ parsers()->shortcodes()->addHandler('strings', static function (ShortcodeInterfa if ($key == 'at') { $content = strings($content)->{'at'}((int) $values)->toString(); } + + if ($key == 'base64Decode') { + $content = strings($content)->{'base64Decode'}()->toString(); + } + } return (string) $content; diff --git a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php index 1ccb4473..97c5d546 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php @@ -39,4 +39,7 @@ test('[strings] shortcode', function () { $this->assertEquals("a", parsers()->shortcodes()->parse('[strings at=0]abc[/strings]')); $this->assertEquals("b", parsers()->shortcodes()->parse('[strings at=1]abc[/strings]')); $this->assertEquals("c", parsers()->shortcodes()->parse('[strings at=2]abc[/strings]')); + + // base64Decode + $this->assertEquals("test", parsers()->shortcodes()->parse('[strings base64Decode]dGVzdA==[/strings]')); }); \ No newline at end of file