Created
April 14, 2014 13:06
-
-
Save rustedwolf/10646137 to your computer and use it in GitHub Desktop.
Usable WP functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Timber functions | |
add_filter('get_twig', 'add_to_twig'); | |
function add_to_twig($twig) { | |
$twig->addFilter('translate', new Twig_Filter_Function('getTranslation')); | |
return $twig; | |
} | |
function getTranslation($string){ | |
return __($string, 'textdomain'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment