Open timknight opened 6 years ago
I did rework the plugin to use the following, but this won't work when Timber is installed as a WordPress library, just when it's installed via Composer.
function __construct(){
add_filter('get_twig', function( $twig ){
$twig->addFilter(new Twig_Filter('dummy', array(__CLASS__, 'apply_dummy_filter')));
$twig->addFunction(new Twig_Function('dummy', array(__CLASS__, 'apply_dummy')));
$twig->addFilter(new Twig_Filter('twitterify', array(__CLASS__, 'twitterify')));
return $twig;
});
}
Maybe there's a way to get it to work with both, but either way for those in a similar situation that'll work.
Are there special considerations that need to made with installing sugar when Timber is installed through Composer? Currently when installing it and trying to execute the dummy function I get an error:
I'm loading Timber within the functions.php exactly as defined on https://timber.github.io/docs/getting-started/setup/#via-github-for-developers.
I've installed Sugar within a different instance where Timber is installed as a WordPress plugin instead and everything seems to function without any issue.