diff --git a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php index ea2fa210..a139980d 100644 --- a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php @@ -130,6 +130,10 @@ parsers()->shortcodes()->addHandler('strings', static function (ShortcodeInterfa $content = (string) strings($content)->{'count'}(); } + if ($key == 'crc32') { + $content = (string) strings($content)->{'crc32'}(); + } + if ($key == 'countSubString') { $content = (string) strings($content)->{'countSubString'}(isset($vars[0]) ? (string) $vars[0] : '', isset($vars[1]) ? strings($vars[1])->toBoolean() : true); } diff --git a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php index b9bb8a24..35b65326 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php @@ -85,4 +85,7 @@ test('[strings] shortcode', function () { $this->assertEquals(1, parsers()->shortcodes()->parse('[strings countSubString=test]Test string here for test[/strings]')); $this->assertEquals(2, parsers()->shortcodes()->parse('[strings countSubString=test|false]Test string here for test[/strings]')); + // crc32 + $this->assertEquals(3632233996, parsers()->shortcodes()->parse('[strings crc32]test[/strings]')); + }); \ No newline at end of file