Toolbox for Beaver Builder

toolbox_timber_posts_data

This filter allows you to extend the data for the ACF Field Module and Timber Posts Module even further. It will also allow you to expose custom variables to the Twig template by passing them into this filter.

Parameters

  • $data (array)

Usage

<?php

add_filter( 'toolbox_timber_posts_data' , 'my_custom_data' ,10 ,1 );

function my_custom_data( $data ) {
    $data['mydata'] = array(
                        'firstname' => 'John',
                        'lastname'	=> 'Doe'
                  );
    return $data;
}

After which you can use the variables in your Twig template.

{{mydate.firstname}}
Last modified: October 30th, 2018