A great way to spin up new WP plugins with composer.
Need | Solution |
---|---|
Template Loader | gamajo/template-loader |
Need | Solution |
---|---|
CPT/Taxonomy Registration | johnbillion/extended-cpts |
From the terminal just run the following command.
composer create-project mindsize/wp-plugin-base my-new-plugin
Find | Replace | Why |
---|---|---|
Mindsize\WP_Plugin_Base |
Mindsize\Your_Plugin |
Update the plugin namespace. |
WP_PLUGIN_BASE_ |
YOUR_PLUGIN_ |
Update the plugin constants. |
wp_plugin_base |
your_plugin |
Update the plugin wrapper function. |
At Mindsize we believe in composer driven projects, and most of our plugins require an autoloaded generated by Composer. This means installation of our plugins may an extra step to generate this autoloader.
If your WordPress website is powered by composer and already is loading the vendor autoload file, just require the plugin by running the command below from your terminal.
composer require mindsize/wp-plugin-base
After cloning this repository, run composer install
in the root directory of the plugin. If you are using git based deployments, make sure the vendor directory is no longer ignored.
Packaged releases on WordPress.org will automatically include the required autoloaders.