I last went over the features of generator-plugin-wp in May and a lot has changed since then! There are three more sub-generators (and more on the way), the JavaScript workflow is improved, PHPUnit tests are built in for the main plugin generator and all relevant sub-generators, and the PHP include workflow is easier. New Sub-Generators Since May three new sub-generators have been added CPT, options, and widget. If you missed it last time: a sub-generator is a secondary generator that can be run on a plugin that was previously generate by generator-plugin-wp. So if I wanted to add a feature to a plugin I’m working on I could run yo plugin-wp:cpt book to add a new include file to my plugin that creates a book CPT. The CPT sub-generator adds a new php class to the plugin which extends CPT_Core and by default includes CMB2 fields for the new CPT. The options sub-generator adds a new php class which creates an admin options page with CMB2 available to build it out. The widget sub-generator adds a new php class with the skeleton code to create a widget. Using these sub-generators in addition to the previously available include, CSS, and JS sub-generators brings the speed of building out
Share This