WordPress 3.9: Setting Image Crop Positions
17th April 2014
Of all the improvements to existing WordPress functionality in the latest core update (3.9) there was one that caught my eye – the ability to set image crop positions. By default thumbnails crop center both horizontally and vertically, which means that if you upload a portrait and it crops square the head gets cut clean off. Sure you can go in and edit the thumbnail, but it’s a real drag if you’re uploading multiple images.
Now though, developers will be able to set some parameters which control where to position the crop. That means you can set, for example, a center top crop to prevent the aforementioned problem. Here’s how to make use of this small but important change:
add_image_size( 'new-thumbnail-size', 300, 300, array( 'center', 'top' ) );
NB: Because this post is more than two years old, and the world of web design and technology moves on so quickly, the information in it may now be out of date