Skip to content

Instantly share code, notes, and snippets.

@rustedwolf
Created April 14, 2014 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rustedwolf/10646137 to your computer and use it in GitHub Desktop.
Save rustedwolf/10646137 to your computer and use it in GitHub Desktop.
Usable WP functions
// 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