lib/Twig.php
public function add_timber_escapers( $twig ) {

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_url', function( \Twig_Environment $env, $string ) {
			return esc_url($string);
		});
		$twig->getExtension('Twig_Extension_Core')->setEscaper('wp_kses_post', function( \Twig_Environment $env, $string ) {
			return wp_kses_post($string);
		});

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_html', function( \Twig_Environment $env, $string ) {
			return esc_html($string);
		});

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_js', function( \Twig_Environment $env, $string ) {
			return esc_js($string);
		});

		return $twig;

	}
public function add_timber_escapers( $twig ) {

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_url', function( \Twig_Environment $env, $string ) {
			return esc_url($string);
		});
		$twig->getExtension('Twig_Extension_Core')->setEscaper('wp_kses_post', function( \Twig_Environment $env, $string ) {
			return wp_kses_post($string);
		});

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_html', function( \Twig_Environment $env, $string ) {
			return esc_html($string);
		});

		$twig->getExtension('Twig_Extension_Core')->setEscaper('esc_js', function( \Twig_Environment $env, $string ) {
			return esc_js($string);
		});

		return $twig;

	}
public function add_timber_escapers ( $ twig ) { $ twig -> getExtension ( 'Twig_Extension_Core' ) -> setEscaper ( 'esc_url' , function ( \ Twig_Environment $ env , $ string ) { return esc_url ( $ string ) ; } ) ; $ twig -> getExtension ( 'Twig_Extension_Core' ) -> setEscaper ( 'wp_kses_post' , function ( \ Twig_Environment $ env , $ string ) { return wp_kses_post ( $ string ) ; } ) ; $ twig -> getExtension ( 'Twig_Extension_Core' ) -> setEscaper ( 'esc_html' , function ( \ Twig_Environment $ env , $ string ) { return esc_html ( $ string ) ; } ) ; $ twig -> getExtension ( 'Twig_Extension_Core' ) -> setEscaper ( 'esc_js' , function ( \ Twig_Environment $ env , $ string ) { return esc_js ( $ string ) ; } ) ; return $ twig ; }
Adds escapers to Twig.

@param \Twig\Environment $twig The Twig Environment.
@return \Twig\Environment
Adds escapers to Twig .