Releases: timber/timber
Releases · timber/timber
Author Roles & Permissions
Changes for Theme Developers
- Adds support for roles on the user object. Example:
{{ post.author.roles }}which returns an array of roles #1898 (thanks @palmiak) - Adds support for capabilities on the user object. Example:
{{post.author.can("moderate_comments")}}which returns true or false #1898 (thanks @palmiak)
Fixes and improvements
- Fix an error with handling args for nav menus #1865 (thanks @palmiak)
- Allowed tags won't be stripped when automatically generating an excerpt #1886 (thanks @davefx)
- Fix for JPG/WEBP conversion for some older PHP installs #1854
WordPress & PHP Support
Timber now requires PHP 5.6 or greater. While Timber may work on PHP 5.5 and older versions; support will no longer be maintained in future versions.
Resolve pagination escaping issue
Hot fix for PHP 5.5 <
Refactored something in Post.php that caused an error in PHP 5.5 and 5.4 #1850
Responsive Image attributes and other fixes
Changes for Theme Developers
- You can now change the query parameters that are used when getting a post’s terms through
$post->terms(). #1802 - New attributes for responsive images
post.thumbnail.srcsetandpost.thumbnail.sizes#1819 (thanks @maxxwv)
Fixes and improvements
- Using WordPress's
wp_check_filetype_and_extfor the mime_type mess #1843 (thanks @gchtr) - Fixed how some previewed data (when looking at an unsaved post from the admin) is handled so that parenting relationships match what happens when published #1752
- Timber\Menu now respects modifications sent through WP's
wp_nav_menu_objectsfilter #1814 (thanks @pascalknecht)
Fix for mime_type detection in some PHP installs
- Fixed how mime_type was figured out in some PHP installs #1798
WebP support
ACF Bug Fix
Okay, one more
Fixes and improvements
- Fixed some issues with animated gif resizing when Imagick isn't available #1653
- Fixed incorrect reporting of depth level in some comments #1648
- Fixed issues with preview permissions #1607
- Fixed issue with image resize in some WPML setups #1625
- Fixes compatability issues with Twig 2.4 (and later) #1641
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
|filterfilter 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