There is no license information available for the latest version (dev-master) of this package.

dev-master 2015-04-05 00:57 UTC

This package is auto-updated.

Last update: 2023-11-29 02:19:03 UTC


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]');


Use Composer. That's what all the cool kids use.

"require" : { "badcow/shortcodes": "dev-master" }

Running Tests

phpunit /path/to/shortcodes

Build Status

Build Status