I’ve built many, many WordPress sites, each with quite a few custom post types, (or CPTs for those in the know 🙂 ). There are many procedural ways to go about this task, especially in the WP world of pseudo-OOP. I decided on a class that I can hook up to any new install, with a method for each post type for readability sake.
Since we want all of the CPTs available, I built a little shortcut into the constructor with call_user_func().
We slice out the constructor (obviously..) and use whatever convention we want for the methods.
Note that this should go inside a WP init action hook.