Plugin Builder
This is a plugin for WordPress plugin developers. If you don’t understand what PHP , HTML , CSS , add_action and apply_filters are then this plugin is not for you! The WordPress Plugin Boilerplate is a fantastic tool for standardising WordPress plugins, and encouraging developers to use best practic
This is a plugin for WordPress plugin developers. If you don’t understand what PHP , HTML , CSS , add_action and apply_filters are then this plugin is not for you!
The WordPress Plugin Boilerplate is a fantastic tool for standardising WordPress plugins, and encouraging developers to use best practices. But manual editing of every file to enter the name of the plugin, the author name and all the other metadata is a bit of a chore. This plugin automates that process, giving you a simple form to enter your metadata, then when you hit the ‘Build’ button your new plugin is created with all the correct metadata.
But there’s more. You can also define Custom Post Types and even other custom classes which will have .php files created automatically, and all the relevant code to include those files in your plugin. Once your plugin is built you can, of course, edit the files in any way you want to add extra methods.
Plugin Builder will even create a manager class for your Custom Post Types if you want, as a place to store methods related to your CPTs – such as a get_all() method, for example.
And that’s not all. Some developers like to include extra items in their plugins, like utility classes or frameworks such as the WordPress Settings Framework . Plugin Builder automates that process, too, by downloading and including the files you choose in your new plugin.
Plugin Builder comes with a range of these additional includes you can choose from, but if there are other items you want to include you can make those part of the build process really easily (by extending a simple interface and using a filter).
So, let’s look at the traditional way of using the WordPress Plugin Boilerplate to create a new plugin:
- 01Download the Boilerplate and extract it
- 02Rename all the files using your plugin name (e.g. ‘class-plugin-name.php’ to ‘class-my-plugin.php’)
- 03Go through all the files and replace the metadata with your plugin details (name, slug, author, URIs etc)
- 04Create your CPT class and the registration code,
- 05Add the code to include the CPT file and register the CPT with WordPress
- 06Create a custom class
- 07Add the code to include your custom class file