Skip to content

Commit

Permalink
[FEATURE] Simple shortcodes can be defined in config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Netzweberei committed Mar 1, 2016
1 parent 8117c59 commit 127c028
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/shortcode/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public function __construct()
{
$this->config = DI::get('Config');
$tags = $this->config->get('plugins.config.shortcode', []);

// Feature 20160224: Define simple shortcodes also in config.yml
foreach($tags as $tag => $_callable){
$tags[$tag] = create_function('$atts, $content', $_callable.';');
}

$this->shortcode = new Shortcode($tags);
DI::set('Shortcode', $this->shortcode);
}
Expand Down

0 comments on commit 127c028

Please sign in to comment.