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
It’s boring….!
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:
Thanks another great post, very interesting and thanks for sharing.
WOW. Cool!
was amazing … I ‘ve tried to like in the video tutorial , but only empty display only. Can I be given an example file ?? so they can find out what is wrong to follow video tutorials . thank’s
@dewah – I understand your frustration; the video does move rather quickly. I went through it pausing the screen frequently and making notes of what was happening, especially what/where files are being created.
If you’re getting a blank screen chances are you encountering a fatal php error; turn debug on to see the error. In my case I forgot to place a leading “/” in from of the pathname in an include statement.
Where I put the files?
Hi! someone has publish the delete function on github, but it is imcomplete! Can you please update it? Thank you
You are welcome to send a pull request 🙂
This is Awesome !
Thank you !
i think i was in too hurry after see video , followed but showing just blank page , not even error 🙁
Nice, that plugin is support all version of wordpress?
Yes, pretty much!
wow, really interesting but the lack of better usage instruction is inexcusable.
author should have put together a quick readme or similar document to make it easier to use instead of the video. or simply just zip up the sample plugin he created in the video so we can see where files go and how they are called.
If you are going to share than share with love.
Cool, I can learn quickly with this generator. Thanks 😀
Nice!
And how to delete item?
I tried to generate the list table but the generated code keeps giving me a 500 error….regardless if the table is prefixed with wp_ or not
Can you please help me with this Tareq? This is an urgent issue
I had the same problem, look for the file class-admin-menu.php line 56 and just add an else like this to the file exists where it includes the template
if (file_exists($template)) {
return include $template;
} else {
echo “View file not found”;
}
my problems was in filenames and with this you can have the error…
It’s given 500 error, would you like to help ?