public function add_to_twig( $twig ) {
		$wrapper = $this;

		try {
			$twig->addFunction( new Twig_Function( $this->_function, function() use ( $wrapper ) {
				return call_user_func_array( array( $wrapper, 'call' ), func_get_args() );
			} ) );

		// Use empty 'catch' block and not 'finally', because finally needs PHP 5.5 to work.
		} catch ( \Exception $e ) {}

		return $twig;
	}