From 127c02823fbe31f66b0f9f405d6ac0de678d9fe3 Mon Sep 17 00:00:00 2001 From: Andreas Neumann Date: Tue, 1 Mar 2016 15:24:45 +0100 Subject: [PATCH] [FEATURE] Simple shortcodes can be defined in config.yml --- plugins/shortcode/shortcode.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/shortcode/shortcode.php b/plugins/shortcode/shortcode.php index 54f009d9..010fed9a 100644 --- a/plugins/shortcode/shortcode.php +++ b/plugins/shortcode/shortcode.php @@ -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); }