I just got a hang of writing my first plug-in. It consist of two custom post types, with two different types of custom meta boxes attached to them. I got the saving of that working and even a function for a shortcode and displaying it on the front end.
But it all turned out really messy, so I decided to rewrite it. I came over something called “WordPress Plugin Boilerplate” which did seem pretty popular. But I just can’t understand where I should put everything.
https://github.com/DevinVinson/WordPress-Plugin-Boilerplate
Could anyone explain to me where I should play for example, custom post type, add meta box, saving that meta box info etc.
IF NOT maybe someone has a good summary on good plugin structure?
Well, WordPress-Plugin-Boilerplate is some ready made scaffolding based on author’s best practices and common code required by several plugins, you don’t need to use this if your only requirement is just adding custom post types and adding meta boxes. All you need is to create correct plugin header and your CPT code.
For example: