2.0.0
Timber 2.0 is a big update. There are a lot of breaking changes. You need to thoroughly test your websites in your local development environment before update your live websites.
You can install Timber 2.0 by following the Installation Guide. When installing Timber through Composer, you need to require the 2.0.0
version:
composer require timber/timber:^2.0
Documentation
In case you find errors, please open an issue. In case you’re stuck or have questions, create a discussion.
What’s new in Timber 2.0
For information on what’s new in Timber 2.0, follow the Upgrade Guide.
Dropping plugin support
Timber 2.0 is not available as a WordPress plugin anymore, but will only be available as a Composer package. If you’re still using the plugin version of Timber 1.0, you might want to switch to the Composer version first. You can find more information about this in the following links:
- Announcement: Dropping support for the plugin version of Timber
- Guide: How do I switch over from the plugin version to the Composer based version of Timber?
The overall goals of Timber 2.0 include:
- Making Timber’s functions and methods more consistent.
- Making Timber easier to handle and extend.
- Refactoring how Timber Core works under the hood to improve compatibility with WordPress Core and be ready for future challenges.
- Making Timber more compatible with other plugins.
High-level changes include:
- Compatibility with the newest version of PHP.
- A newer, streamlined API for accessing Posts, Terms, Users, Comments and Menus.
- An upgraded Context.
- A new Attachment class for WordPress attachments that are not images.
- A big update for how fetching meta values works.
- Better integration with the WordPress Date and Time functionality.
- Better options to control and extend Twig.
- Class Maps for a more loosely coupled way to extend Timber with your own Post, Term, User, Menu, MenuItem, and Comment objects.
- No more direct instantiation of the classes mentioned above. Use Class Maps instead.
- New PostCollectionInterface for a unified way to deal with various lists of posts.
- An updated WP-CLI integration.
- A new way to add your own Integrations for Timber.
What’s changed since 2.0.0-rc.1
Here’s what’s changed since the last 2.0.0-rc.1 release. (Full Changelog: 2.0.0-rc.1...2.0.0)
Changes
- 2.x Revert final constructors by @gchtr in #2827
- Renamed the
master
branch to1.x
and made2.x
the default branch.
Bugfixes
- Site overwrite magic __call method by @Levdbas in #2798
- Consider
fields
value when returning terms from query by @jrathert in #2806 - Initialize typed properties correctly in
ExternalImage::build()
by @jrathert in #2818 and @nlemoine in #2825
Documentation
- Add documentation and plugin notice about the end of the plugin version by @Levdbas in #2800
- Add note about installing the release candidate by @gchtr in #2796
- Add drop support notice to issue template by @nlemoine in #2810
- Add note about PostsIterator and removal of timber/class/posts_iterator filter by @gchtr in #2835
- Update v2 caching docs by @Levdbas in #2797
- Fix Attachment size doc block by @nlemoine in #2824
- Explained theme path, link and URI helpers in Cheatsheet by @Levdbas in #2787
- Updated plugin support part by @Levdbas in #2805
- Changing functions section references
$filters
instead of$functions
by @niclm in #2799
Become a sponsor
Do you love using Timber for your projects? Consider supporting us by becoming a sponsor. Your sponsorship helps us maintain & improve Timber for everyone! 💚🌲 Join the Timber family today.