Adds is_rtl() function to Twig

This commit is contained in:
Vlad
2017-09-06 20:55:44 -04:00
parent e012bd6cbe
commit 6584250d1a
3 changed files with 34 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
<?php
namespace MailPoet\Twig;
use MailPoet\Config\ServicesChecker;
if(!defined('ABSPATH')) exit;
@@ -86,6 +88,11 @@ class Functions extends \Twig_Extension {
'do_action',
'do_action',
array('is_safe' => array('all'))
),
new \Twig_SimpleFunction(
'is_rtl',
array($this, 'isRtl'),
array('is_safe' => array('all'))
)
);
}
@@ -162,4 +169,8 @@ class Functions extends \Twig_Extension {
$checker = new ServicesChecker();
return $checker->isPremiumKeyValid(false);
}
function isRtl() {
return is_rtl();
}
}