1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 13:16:45 +02:00

feat(shortcodes): update [registry-get] shortcode

This commit is contained in:
Awilum
2022-04-14 12:41:13 +03:00
parent c1c470ad4d
commit 43104d0bb1
2 changed files with 5 additions and 5 deletions

View File

@@ -21,8 +21,8 @@ use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use function parsers;
use function registry;
// Shortcode: [registry_get name="item-name" default="default-value"]
parsers()->shortcodes()->addHandler('registry_get', static function (ShortcodeInterface $s) {
// Shortcode: [registry-get name="item-name" default="default-value"]
parsers()->shortcodes()->addHandler('registry-get', static function (ShortcodeInterface $s) {
if (! registry()->get('flextype.settings.parsers.shortcodes.shortcodes.registry.enabled')) {
return '';
}

View File

@@ -2,9 +2,9 @@
declare(strict_types=1);
test('[registry_get] shortcode', function () {
test('[registry-get] shortcode', function () {
$this->assertEquals('Flextype',
parsers()->shortcodes()->parse('[registry_get name="flextype.manifest.name"]'));
parsers()->shortcodes()->parse('[registry-get name="flextype.manifest.name"]'));
$this->assertEquals('default-value',
parsers()->shortcodes()->parse('[registry_get name="item-name" default="default-value"]'));
parsers()->shortcodes()->parse('[registry-get name="item-name" default="default-value"]'));
});