I'm trying to get the custom field data off an attachment and display it following the image tag in a page/post using the get_image_tag filter.
I'm using the same function to get the same data and display it on the attachment field as well. That works perfectly using the the_content filter so I know the function is working ok and the data is being stored and retrieved.
I feel like I'm missing something really obvious. Based on the few other questions I can find about the get_image_tag filter, it seems like there's either something buggy about its implementation or it doesn't run where it seems like it should. I can't even get it to append a string to the resulting $html variable and I don't get an error with wp_debug = true either.
The code is on Pastebin at http://pastebin.com/VRcEyYBh.