apply_filters( 'clarkson_context_args', $context ) → {array}
Context variables that are available in twig templates.
Parameters:
Name | Type | Description |
---|---|---|
$context |
array | Available variables for the twig template. |
- Since:
- 0.1.0
- Source:
Returns:
Available variables for the twig template.
- Type
- array
Example
// We can make the WooCommerce cart available on each template.
add_filter( 'clarkson_context_args', function( $context ) {
$context['cart'] = wc()->cart;
return $context;
} );