The standalone version of WordPress shortcodes system for use outside of WordPress.
Notice: The kses-related parts have been removed from the shortcode system and are currently not supported.
You can install the package via composer:
composer require nabeghe/wp-shortcodes
use Nabeghe\WPShortcodes\Shortcodes;
$shortcodes = new Shortcodes();
$shortcodes->add('hash', function ($atts, $content = null) {
$atts['algo'] ??= 'md5';
return hash($atts['algo'], $content);
});
$result = $shortcodes->do('
MD5 = [hash algo="md5"]https://github.com/nabeghe/wp-shortcodes[/hash]
SJA256 = [hash algo="sha256"]https://github.com/nabeghe/wp-shortcodes[/hash]
');
echo $result;
Copyright (c) 2024 Hadi Akbarzadeh
Licensed under the GPL-2.0+ license, see LICENSE.md for details.