I have written countless number of plugins in the last 7+ years after I started working with WordPress and created other web applications. No matter what type of applications you are building, simple or complex, small or big, one thing is common, you have to insert some data into the database, fetch them, update them and list them. We simply call it CRUD operation.
As I primarily work with WordPress, mostly I have to do this:
- Register an Admin Menu
- A Callback Function for Listing the Items → WP_List_Table
- Add New Form → Handle the submission, insert items into database
- Update Form → Handle the submission, update items in database
Few days ago I was working on a project that requires multiple database tables and guess what, I have to do the tasks listed above for EVERY SINGLE TABLES. Are you serious? I have to write all those codes again and again for every tables. I simply couldn’t get my head around that idea of writing the codes, as a result I was stuck and no progress was being made on that project. We are programmers, we are lazy people, how could we do such a waste of energy doing the same thing?
I had to come up with a solution, I didn’t want to write the same thing every time I build a plugin. So, as always, the generator was made, out of frustration and laziness of course 😀
Here is a quick demo of the working project: