WordPress ‘Attachments’ Plugin Debut
Published 6 years 3 months ago on November 2, 2009 — 3 min read
Some time ago, I began meddling around with WordPress plugins. I had a specific need that WordPress wasn’t quite up to handling out of the box, and any existing plugins were far too over the top for my taste. I’m probably a bit different than most WordPress users in that I like to get my hands dirty with plugins. I’m not a fan of shortcodes doing all the work; I’d much rather integrate the plugin data directly with my theme using good old PHP.
That said, I had an issue where I need to append any number of images to a Post. Sure, WordPress has its image gallery feature built into the editor, but I wasn’t looking for that. I didn’t want WordPress organizing and generating the content for me. It’s not that WordPress dumps out poor markup, it’s just that I was looking to build things by hand.
A number of hours later, Post Gallery emerged. According to the official WordPress Extend page, Post Gallery has been downloaded over 3,000 times. I continue to get a fair number of support requests for the plugin, and I’m really glad to have written it as it taught me quite a bit.
One of the biggest things it taught me was that it could have been written better. A lot better. So I did it, I took all of the shortcomings I saw with the plugin and completely reworked it from the ground up.
Post Gallery will officially be deprecated in favor of Attachments, a brand spankin’ new plugin that serves (in part) the same purpose.
What’s different about Attachments
As I continued to use Post Gallery on various projects, I began to wonder why the heck I decided to store the media in its own table, tucked away from the WordPress Media Library. That was the first bug under my skin. From there, technical issues with media storage snuck in by way of support emails. Then came the issue of wanting to use an image that was previously uploaded; you had to re-upload it. I was quick to decide that the rewrite would absolutely make direct use of WordPress’ Media Library. Not only does using the WordPress Media Library cut out reinventing the wheel, it allows users to recycle the same upload any number of times.
Another peeve I had with Post Gallery was the sorting I had implemented. Needless to say, you can drag and drop to reorder items in Attachments.
The official plugin home page
As of right now, I’m waiting for the WordPress team to officially add Attachments to the WordPress plugin repository. For the time being, if you’re interested in the plugin, you should first follow me on Twitter (@jchristopher) for updates, and then head over to the plugin home page as that will be home base until approval is granted.
In the meantime, if you’d like to check out a quick screencast overview of Attachments, here goes:
Suggestions more than welcome
Attachments will be my pet project for the next few months, as I’ve got a lot of ideas for handling the browse dialog. I realize that it could quickly become overwhelming with lots of media, so I’m going to begin scoping out some possible solutions. If you’ve got a use for Attachments and have any ideas for improvement, by all means let me know!