How would I be able to hook onto an attachment in real time on upload. So far I have found using the hook add_attachment. I want to be able retrieve the $post_id and the files metadata.
I tried add_action(add_attachment, custom_add_attachment); but it’s not displaying the $post_id when I test it.