Filter: clarkson_twig_environment

apply_filters( 'clarkson_twig_environment', $twig ) → {TwigEnvironment}

Allows themes and plugins to edit the Clarkson Twig environment.
Parameters:
Name Type Description
$twig TwigEnvironment Twig environment.
Since:
  • 1.0.0
Source:
Returns:
Twig environment.
Type
TwigEnvironment
Example
// We can add custom twig extensions.
add_filter( 'clarkson_twig_environment', function( $twig ) {
 $twig->addExtension( new \Custom_Twig_Extension() );
 return $twig;
} );