1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-11 23:54:06 +02:00

Shortcodes: new default shortcode [site_url]

This commit is contained in:
Awilum
2019-01-21 20:04:58 +03:00
parent dee1f0ecba
commit 7333a925b2

View File

@@ -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) {