How to Add Additional Fields to the WordPress Media Uploader
While working on a project where we created a very cool gallery powered totally by WordPress attachments and a custom post type, we found a need to add additional fields to the WordPress media uploader. These additional fields allowed us to give each photographer credit by adding photographer name, and their URL on each image page. WordPress stores images as posts in the attachment post type, so adding meta data is just like adding custom fields. Because the WordPress attachments does not have a custom fields UI, we have to add a custom fields to the media uploader in order to collect the meta data. In this article, we will show you how to add additional fields to the WordPress Media Uploader.
How To Add Custom Fields To WordPress Media Uploader
If you’re a photographer or something like that, then you might wanna add copyright or some other custom fields to WordPress media uploader to customize your blog’s front-end or just for giving the original photographer some credits. WordPress stores images as posts in the attachment post type, so adding some custom data is like adding custom fields to attachment post type. Here’s how you can do that.
Getting Started with the WordPress Media Uploader
It’s important to note, though, that the most recent version of the uploader is built using a set of completely different technologies than those prior. This means that the code that you once wrote to implement custom media management may still work (until the core Thickbox code is deprecated), but that it’s going to look and feel dated in comparison to what users are now experiencing whenever they manage their media within WordPress.