badcow / shortcodes
Installs: 25 704
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.9
This package is auto-updated.
Last update: 2024-10-29 04:19:53 UTC
README
This is a port of WordPress' brilliant shortcode feature for use outside of WordPress. The code has remained largely unchanged.
The purpose of this project is to use the familiar WordPress shortcode syntax in any system.
Basic Usage
$shortcodes = new Badcow\Shortcodes\Shortcodes;
$shortcodes->addShortcode('hello', function ($attributes, $content, $tagName) {
return $attributes['greeting'] . ', ' . $content;
});
echo $shortcodes->process('My shortcode does this: [hello greeting="Konnichiwa"]world![/hello]');
Installation
Use Composer. That's what all the cool kids use.
"require" : { "badcow/shortcodes": "dev-master" }
Running Tests
phpunit /path/to/shortcodes