Answer the question
In order to leave comments, you need to log in
How to write a plugin for wordpress?
Hello! I just started learning wordpress, I'm trying to write a photo gallery plugin, because I think that through writing plugins you can get to know wordpress more deeply than just pulling the layout. I am a beginner in php, and in everything else too, for this reason I ask for help from more knowledgeable people, how best to implement this photo gallery? The question is, to load images, I want to use the standard wordpress media loader, creating two database tables, one with the names of the galleries, the second to hold the photos attached to it, and their description, linking them using a foreign key. And here is the problem concerning the essence of the question, how best to implement all this. Since the media loader creates its own image databases, and if I understand correctly, the main thing for it is the id of the loaded photo. But I also need image IDs, but in this case I risk getting two photos with the same ID on the same page if I start creating my own (although the probability of this is, of course, very small). Another option is to load identifiers from the tables of the standard loader, and reload them into your tables, and use them to get image data from the media loader table. The disadvantage of this method is an extra database query, plus that I can have one image with a different description. Actually, this was the question, how best to implement image storage? And since I'm already here, I'll ask one more question, how wordpress implements the creation and updating of posts, and so on. (for example, the same photo galleries), check if the topic identifier exists, and if it exists, update it, and if not, create it, how so yes? Or use two different pages to create and edit posts.
Answer the question
In order to leave comments, you need to log in
I think that through writing plugins you can get to know wordpress more deeply
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question