As part of my work as Webmaster at the German Archaeoligical Institute i have to make sure the online presences of the institute are up to current legal standards. In the last years the topic of image attribution has gained largely in importance.
The task at hand was to provide the content creators of the institutes many departments with a tool to manage image attribution as metadata. Simply adding those to the images “caption” was not an ideal solution because over the years thousands of images accumulated already.
I played around with freely available plugins such as “Advanced Custom Fields” and its versatile abilities to interact with other plugins but couldnt approach a satisfiying solution.
The solution was to write a plugin that fit the specific needs of the institute. I specified to custom fields that extend the metadata of media attachments, “Photographer” and “Copyright”. First, I added those fields to the Media attachment detail view where the content creators could add the information after upload.
Next i added both custom fields to the admin media view and made both columns sortable so that the content creators could sort through their images and retrospectively add the missing metadata. To deal with the already existing images i added a script that would fill the additional metadata info for existing images with default values upon installation of the plugin.
Finally, i added a functionality to generate a preformatted prefix that would be added to the images “caption” field. Instead of adjusting the theme files to display the custom fields I opted to integrate the custom fields into a common metadata because the WordPress Multisite network employs a multitude of different themes and i had to make sure the information would be displayed correctly on all of them.
With that solution in place the content creators can sort through their collection conveniently and update the missing metadata. It will be displayed automatically on their posts and credit is finally given where credit is due.
The complete code can be found on my GitHub.