I released a code generator on the site last night that I thought was worth a blog post. I have also added it to a new section on the site aptly named “Generators”. I have a couple of WordPress related code generators in mind and this is the first of them.
You can now easily, and within minutes, generate the code needed to register a custom post type for WordPress. It is done through an easy wizard-driven form that will output your code once you have filled in all the fields. No coding experience required, and I also tried to explain what each field is for, so hopefully anyone at any level will find it useful.
Why Create A Code Generator
I wanted a way to easily create the code for registering a custom post type, without needing to constantly check the WordPress codex or plugin development books, because there are over 20 arguments that can be used. I also wanted a nice alternative to using a CPT plugin. And the last reason was I wanted to challenge myself and see if I could do it. I wanted to push Gravity Forms to it’s limits, and once again I am not disappointed.
How Was It Made
The form itself is made using Gravity Forms, made up of 6 pages and 48 fields. Yes 48! It took a helluva long time to add the fields.
I added some extra jQuery magic to pre populate some fields (including using the typewatch plugin)
I wrote a WordPress plugin that takes the form entry and fills in a template and outputs the code
Give It A Try
Please give it a try and let me know what you think by leaving a comment below. And as always, please feel free to donate if this code generator has helped you in some way. This code generator took a lot of my spare time to develop, so any donations go a long way in keeping me motivated