Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nabeghe/wp-shortcodes
A standalone version of WordPress shortcodes system for use outside WordPress.
https://github.com/nabeghe/wp-shortcodes
Last synced: 13 days ago
JSON representation
A standalone version of WordPress shortcodes system for use outside WordPress.
- Host: GitHub
- URL: https://github.com/nabeghe/wp-shortcodes
- Owner: nabeghe
- License: gpl-2.0
- Created: 2024-09-22T07:38:50.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-09-22T07:40:03.000Z (about 2 months ago)
- Last Synced: 2024-10-28T16:18:18.462Z (22 days ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# WP Shortcodes
The standalone version of [WordPress shortcodes](https://github.com/WordPress/WordPress/blob/d2c835af27d4e4c42b97f422a0aa98b8fd3fb7cd/wp-includes/shortcodes.php#L63) 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:
```bash
composer require nabeghe/wp-shortcodes
```### 📁 Localization Directory
### Example
```php
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;
```
## 📖 LicenseCopyright (c) 2024 Hadi Akbarzadeh
Licensed under the GPL-2.0+ license, see [LICENSE.md](LICENSE.md) for details.