badcow/shortcodes

此包最新版本(dev-master)没有提供许可证信息。

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

This package is auto-updated.

Last update: 2024-08-29 04:03:12 UTC


README

这是WordPress卓越短代码功能的移植,用于WordPress之外的环境。代码基本保持不变。

此项目的目的是在任何系统中使用熟悉的WordPress短代码语法。

基本用法

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

安装

使用 Composer。这是所有酷孩子都在使用的。

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

运行测试

phpunit /path/to/shortcodes

构建状态

Build Status