Automatically enables in the Timber twig context variable all user-defined advanced custom fields.
This plugin is intended for developers that are using Advanced Custom Fields and Timber to develop their themes.
By enabling this plugin the user-defined advanced custom fields will be available in the Timber context variable as follows:
Fields defined for users will be available on the \Timber\User object under the “fields” key
Defined menus will also be available everywhere under the “menus” key
Also adds twig functions for images:
<img src="{{ post.thumbnail.src('large') }}" {{ srcset(post.thumbnail,'large') }} />
<img src="{{ post.thumbnail.src('large') }}" {{ image_attr(post.thumbnail,'large') }} />
Because that’s not a truly MVC approach. You can still use the get_field() function in twig, but it’s easier for the frontend developer to have everything available directly in the context variable.
Timber does not transform Images, Galleries, Posts, Taxonomies or Users to the equivalent Timber Object when using get_field() or accessing the field directly in the post object. You will need to cast each of these in order to use them as Timber Objects without using our plugin.