From 7333a925b2a315c0d5b72aa388f0721ee575fc35 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 21 Jan 2019 20:04:58 +0300 Subject: [PATCH] Shortcodes: new default shortcode [site_url] --- flextype/Shortcodes.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flextype/Shortcodes.php b/flextype/Shortcodes.php index 78c50a81..8092f06f 100644 --- a/flextype/Shortcodes.php +++ b/flextype/Shortcodes.php @@ -12,6 +12,7 @@ namespace Flextype; +use Flextype\Component\Http\Http; use Flextype\Component\Event\Event; use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Shortcode\ShortcodeInterface; @@ -113,6 +114,11 @@ class Shortcodes { */ private static function addDefaultShortcodes() : void { + // Shortcode: [site_url] + Shortcodes::shortcode()->addHandler('site_url', function() { + return Http::getBaseUrl(); + }); + // Snippets // Shortcode: [snippet name=snippet-name] Shortcodes::shortcode()->addHandler('snippet', function(ShortcodeInterface $s) {