nabeghe / wp-shortcodes
A standalone version of WordPress shortcodes system for use outside WordPress.
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nabeghe/wp-shortcodes
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2025-10-08 13:42:17 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
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.