0

I created a Wordpress plugin, which allows the admin to add information through a form, and it is saved in the database. I'm trying to link each photo that I upload in the Media library with a form.

In other words, my objective is that I want to put my own caption in each image of the Media library, and this caption is taken through a form.

So I have the data from the form fields in a table in my db and another table with the media pictures. How can I link them between each other?

Does anyone have an idea about what can I do?

0

Assuming the images are posts. Register a new post meta for them and use the ID for your form in that post meta, this will allow you to relate to the form.

https://codex.wordpress.org/Function_Reference/add_post_meta

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.