Skip to content

The purpose of this project is to use the familiar WordPress shortcode syntax in any system.

Notifications You must be signed in to change notification settings

Badcow/Shortcodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Badcow Shortcodes

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

Build Status

Build Status

About

The purpose of this project is to use the familiar WordPress shortcode syntax in any system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages