I have a seperate database with lists of users, brochures and brochure URL's, and timestamps of when a brochure was ordered, but I want my database to update everytime a brochure (PDF) attachment is updated in the admin back end of wordpress.

When a user requests a brochure they receive a reminder after a few days wiuth a link to the PDF they requested. I have most of it figured out I just need to know how this link can constantly link to the latest PDF of the brochure they requested.

Thanks :)


You can hook into add_attachment and/or edit_attachment actions and carry out an update on your separate database with the appropriate info. In both cases the attachment ID seems to be the only argument but you can easily get_post or get_post_meta if you need anything else.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.