Releases: timber/timber
Releases · timber/timber
Official 1.3.0 Release
- Default $context object now returns a PostQuery for $context['posts'] this is cool because you can use
{{ posts.pagination }}
in your Twig templates without any further PHP work (thanks @lggorman) - Timber\Images with PDFs and other content types now return the file instead of null # (thanks @hoandang)
- Timber\Comments now support different comment types #1364 (thanks @yantei)
- Timber\Comments {{ comment.content }} now returns processed comment with
<p>
tags - Fix for HTTP error when uploading media files in Windows #1346 (thanks Matias Griese)
- Fix for image resizing on alternative WP setups (thanks @gillesgoetsch)
- Exposing a function to global Twig scope through Timber\FunctionWrapper is deprecated, the prefered method to do this is through a Twig template like
{{ function('my_cool_function', 'my_argument') }}
(thanks @gchtr) - Fixed issues with use of Twig 2.0 (#1370)
- Fixed up some things with Timber/Archives and getting post_count #1376
- Don't let Timber fail when converting TIFFs or other weird file types, instead return the passed value w/o modifying #1383
- Updated
FunctionWrapper
with appropriate warnings and Twig 2.0 compat (thank you thank you @gchtr) - Misc fixes to documentation
Release Candidate for version 1.3.0 (part 2)
- Updated
FunctionWrapper
with appropriate warnings and Twig 2.0 compat (thank you thank you @gchtr) - Misc fixes to documentation
Release Candidate for version 1.3.0
Fixes to comments; better pagination support
- Uses Twig 2.0 for PHP 7 users who install w Composer
- Default
$context
object now returns a PostQuery for$context['posts']
this is cool because you can use{{ posts.pagination }}
in your Twig templates without any further PHP work (thanks @lggorman) Timber\Images
with PDFs and other content types now return the file instead of null # (thanks @hoandang)
*Timber\Comments
now support different comment types #1364 (thanks @yantei)Timber\Comments
{{ comment.content }}
now returns processed comment with<p>
tags- Fix for HTTP error when uploading media files in Windows #1346 (thanks Matias Griese)
- Fix for image resizing on alternative WP setups (thanks @gillesgoetsch)
Fixed regression with default image sizing
Fix to S3 Image Handling
- Fixed a potential XSS security issue
- Fixed handling of images stored on S3
Fixes to image handling
- A bunch of fixes to how images in themes are handled #1317 #1293 (@jarednova)
- Fixed filter for avatar images in comments #1310 (@xavivars)
- Upgrades to PHPUnit and testing suite (@jarednova)
1.2.0 fixes & refactoring
Comment Threads and WordPress 4.7
Comment Threads
You can now more easily fetch an manipulate threads of comments thanks to the fancy new CommentThread object! Why?
- Adds depth info
- Nests by default (thus, the change from 1.1.* to 1.2)
- Supports future syntax features
Usage:
post.twig
<h1>{{ post.title }}</h1>
<article>{{ post.content }}</article>
<section class="comments">
{% for comment in post.comments %}
{% include "comment.twig" %}
{% endfor %}
comment.twig
<div class="comment-{{ comment.id }} depth-{{ comment.depth }}">
{{ comment.content }}
<p class="who">{{ comment.author.name }}</p>
<div class="replies">
{% include "comment.twig" %}
</div>
</div>
You can also do fun stuff when fetching comments like {% post.comments.order('DESC') %}
or `{% post.comments.orderby('comment_author') %}
WordPress 4.7
The new version of WP introduced a bevy of small changes that broke a number of low-level Timber features. These were items caught by UnitTests (no reports of users seeing strange behavior), but out of an abundance of caution these were held until Timber 1.2 to reduce possibility of breaking live sites.