Releases: timber/timber
Releases · timber/timber
Last Major 1.x Release
Changes for Theme Developers
- You can now easily access all of a MenuItem's master object properties through
{{ item.master_object }}
What's a master object? It's when a Menu Item has been created directly from a Post or Term in the WP Admin #1577 #1572 - Enabled methods for getting media from posts, you can now do
{{ post.video }}
,{{ post.audio }}
and{{ post.gallery }}
to retrieve media include in the body of a post #1583 (thanks @marciojc) - You can now get ACF's field object data:
{{ post.field_object('my_field').key }}
#1597 #1599 (thanks @palmiak) - You can use the
|filter
filter on arrays to return items like so:
{% for post in posts|filter('my-slug') %}
{{ post.title }}
{% endfor %}
by default it looks for slugs, but you can also get into particular fields:
{% for post in posts|filter({post_title: "Cheese", post_content:"Method Man"}) %}
{{ post.title }}
{% endfor %}
... this will return posts that match both parameters. #1594 thanks @pablo-sg-pacheco
Menu fix
Transparent Letterboxing, misc. fixes
Fixes and improvements
Changes for Theme Developers
- You can now interact with Terms in Twig the same as PHP (ex:
{% set term = Term(34, "arts") %}
). The second arg will default to a subclass of Timber\Term if it exists #1159 (@jarednova) - You can now get
{{ theme.version }}
to get the theme version! #1555 (thanks @herrschuessler)
Performance Wins!
Fixes and improvements
home_url
value is now cached, performance win for polylang! #1507 (thanks @oxyc)Post::$css_class
is only fetched if requested #1522 (thanks @ruscon)- Stop loading a class object to test if it's a valid
Timber\Post
it forPostGetter
#1522 (thanks @ruscon) - Improved flexibility of PostCollection to be filterable #1544 (thanks @gchtr)
- More test coverage
Changes for Theme Developers
- None! But the above fixes have significant changes in the code which necessitated the
".x"
version jump
Quick fixes for 1.4.*
Fixes and improvements
- Fix for WPML URLs in some situations #1513 (thanks @ChrisManganaro)
- Fix for PHP 5.5 issue with some URLs #1518 (thanks @danFWD)
Gif fixes; loader improvements
Fixes and Improvements
- Improve GIF resize performance #1495 (thanks @ahallais)
- Fix for get_host which could generate an unnecessary warning #1490 (thanks @ahallais)
Changes for Theme Developers
- Improve loader performance and logic #1476 #1489 #1491 (thanks @heino). This introduces potential changes if you were loading templates in a non-standard way and with multiple sources (ex: from a theme and plugin directory). Non-existing templates are no longer passed all the way to Twig’s
render()
, which currently generates an exception.
Twig 2.0 / 1.0 Compatibility Fix
- Fix for Twig 2.0 compatibility issue with functions in Twig #1464 (thanks @luism-s)
HTTPS Fix
Roots, WPML and HTTPs fixes
- Fix for image bug with WPML and Roots/Bedrock active #1445 (thanks @njbarrett)
- Fix for some HTTPs issues #1448 (thanks @baldursson)
- Improved docs! #1441 (thanks @gchtr)
- Allow ACF to convert single WP_Post objects to Timber Posts #1439 (thanks @luism-s)
Bug fixes for 1.3.0
- Fix for Timber::get_widgets with Twig 2.0 #1422 (thanks @gchtr)
- Fix for WPML Menus #1414 (thanks @mikeyb31)
- Fix for WPCLI integration #1429 #1430 (thanks @vyarmolenko)
- Fix for image format processing #1421 (thanks @mgussekloo)