-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Starter plugin and build process for making WordPress plugins, inspired by and intended to work in tandem with WP Rig.
WP-Gizmo is meant to run in the plugins directory of a WordPress Installation. If you plan to use github for version control on your new plugin, the easiest way to do this is to click the green Use This Template
button from the homepage of this repo, choose a new name, and then pull it down to the plugins directory of your development environment's WordPress installation. However, you can also clone or download this repo into the plugins directory of your development environment's wordpress installation go from there.
WP-Gizmo rquires composer and npm to run properly.
- Create a new repo from this template on GitHub, or clone this repo down to the plugins directory of your dev environment's WordPress installation and name it
[your-plugin-name]-gizmo
. - From the WordPress dashboard, activate the WP-Gizmo development plugin.
- From the command line, run
composer install && npm install
. - Update
config.json
with your new plugin's name and slug, and update the plugin comment inwp-gizmo.php
(the plugin name & slug will be replaced in the bundle process. The author name, plugin URI, etc. will not)
This project doesn't have a build/bundle process yet, so if you're only worried about the short-term, you can name your project anything you like without a problem. However, the plan is to create a bundle process that will output a new directory named after your plugin, so I strongly recommend against naming your repo after your plugin. Instead, consider suffixing your desired plugin name with gizmo
or prefixing with wp-gizmo
, though really any name that is different than your final plugin name will do:
wp-gizmo-[plugin-name]
[plugin-name]-gizmo
So, if you were making the omniwrench as a WordPress plugin, you might call your repo wp-gizmo-omniwrench
or omniwrench-gizmo
. That way, when the bundle process is added to WP-Gizmo, its output will be a plugin directory called omniwrench
, with a corresponding omniwrench.php
inside.
While not strictly necessary (this repo will still work in a vacuum as a starting place), WP-Gizmo works best when you take advantage of Git/GitHub. That way, when there are updates to WP-Gizmo, you can pull them into your plugin (or custom version) using version control! Check out the wiki page on WP-Gizmo's recommended git workflow for step-by-step instructions and naming best-practices.
At present, WP-Gizmo is essentially a single-file plugin with a linting setup, ready for you to hack on. Add your functionality to wp-gizmo.php
and test in your local WordPress install. When you're ready to ship your plugin, doublecheck your plugin comment in the main file as well as the slug and name in config.json
, then run gulp bundle
. This will create a new directory in your WordPress plugins directory with your plugin name and slug switched in.
Currently, all documentation lives in this readme and in the WP-Gizmo wiki. There isn't much, but as WP-Gizmo gets built out, the docs will become more robust. So if you need docs for something, please file an issue or get in touch!