News of WordPress 2.9

The WordPress 2.9 Beta 1 is just released. You can download it in the site WordPress Development Updates. What will add this new version? Will be a revolution, or just a simple evolution?
I propose to you to discover some of the new functionalities.

When I reviewed the version 2.8, I tried to explain what could be the evolution strategy of WordPress. One of the most important point was the All in one concept, in other words, the ability to do everything from the WordPress interface, without using other tools (such as FTP client for example).

This 2.9 version seems to be consistent with this strategy. The most important new features are mainly for users:

  • Manage a trash for posts, pages and comments (ability to undo deletion),
  • Image editor,
  • Manage Thumbnails for posts and pages.

Trash

With the current version and previous, a deleted object is definitively lost. You cannot undelete it. The version 2.9 « moves » deleted objects to a trash, and then allows to undelete them when needed. Most of objects are managed: posts, pages, comments, and attachments.

The two following screenshots show how it works:

Post Deletion
Post Deletion
mpty trash
Post Deletion

In the engine:
For posts, pages, and attachments, the field post_status of the table wp_posts accepts a new value: Trash (initial values are draft, pending, publish, and future).

For the comments, modifications are more complex: the version 2.9 adds a new table in the database: wp_commentmeta. When a comment is moved to trash, two lines are added in this table, to keep the ID of the deleted object, and to keep the date of the action.

It’s possible to set the life duration of objects moved to the trash. Today, we can add the following line in the wp-config.php:

define( 'EMPTY_TRASH_DAYS', 5 );

but it would interesting to set this duration from one of the option pages.

Image editor

The other great news of this version, is the ability to edit uploaded images (attachments). Personally, I was not very excited by this kind of function. After I use it, my opinion is more nuanced: editing tools are crop, rotation, flip, resize. These features are well included in the post editing process, allowing a reduced number of global modifications on images. These modifications help us to insert easily images in posts.

New button
New button
Editor screen
Editor screen
Image resize
Image resize

Thumbnails

The thumbnails management is a recurring subject in the WordPress community. Performing it manually, or through a plugin, I don’t know anybody who is satisfied.

WordPress 2.9 adds a new option to the media manager: Use as thumbnail. Managing thumbnails directly in WordPress with WordPress has several advantages:

  • from a user point of view, thumbnails management is fully integrated in the media/attachment manager,
  • from a developper point of view: thumbnails will be easier to manage, especially for theme. We won’t have to use custom fields, or check if a spefici plugin is installed or not.

This feature adds few lines in the administration interface, and adds a new template tag.

New option in the media window
New option in the media window
Additional option in the post editor screen
Additional option in the post editor screen

In the engine:
When we set an image as a thumbnail, WordPress add an additional meta_key named thumbnail_id in the table wp_postmeta.

What are the consequences on the attachments’ management?
The image designated as a thumbnail, is still an image, and is managed as previously by functions such as get_children. The image is also displayed by the shortcode gallery.

A comment about this shortcode: it has two news parameters: include and exclude, which allow to select images to display.

Other news

The other points are less visible. Mainly three categories:

  • Cleaning (remove obsolete and no more used code),
  • Adding functions that help us to manage new features of 2.8 and 2.9,
  • Correction / Consolidation / Update of the existing code.

Some modifications are potentially dangerous for plugins developers. For example, the function get_children() returns an empty array rather than FALSE, when no attachment is found.

A lot of news are dedicated to theme developers:

  • Ability to create templates tags for categories, using the slug (category-{slug}.php). Previously, only ID could be used. Same thing for templates managing tags.
  • Add a new filter excerpt_more to customize the display of the excerpt,
  • Improve functions managing tags cloud,
  • Add a filter to manage comments,
  • Add some attributes and some styles for the links « previous posts / next posts ».

Conclusion

This version 2.9 looks pretty good, because it offers interesting features: the three major innovations are a real step forward for users. Other changes are not negligible either, since they ease the development of themes.

From my side, this version 2.9 will give me some work: at least two of my plugins can be impacted by the new features coming. It will therefore be necessary to test and / or modify them to be ready before the release.