nabeghe / wp-shortcodes
A standalone version of WordPress shortcodes system for use outside WordPress.
1.0.1
2024-11-17 22:37 UTC
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2025-04-17 23:33:34 UTC
README
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.
🫡 Usage
🚀 Installation
You can install the package via composer:
composer require nabeghe/wp-shortcodes
📁 Localization Directory
Example
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;
📖 License
Copyright (c) 2024 Hadi Akbarzadeh
Licensed under the GPL-2.0+ license, see LICENSE.md for details.