Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/WebDevStudios/generator-plugin-wp
Yeoman WordPress Plugin Generator
https://github.com/WebDevStudios/generator-plugin-wp
generator wordpress wordpress-plugin yeoman
Last synced: 3 months ago
JSON representation
Yeoman WordPress Plugin Generator
- Host: GitHub
- URL: https://github.com/WebDevStudios/generator-plugin-wp
- Owner: WebDevStudios
- License: gpl-3.0
- Created: 2015-03-02T18:53:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-05T13:29:26.000Z (about 4 years ago)
- Last Synced: 2024-08-01T17:56:32.000Z (3 months ago)
- Topics: generator, wordpress, wordpress-plugin, yeoman
- Language: JavaScript
- Homepage:
- Size: 530 KB
- Stars: 289
- Watchers: 47
- Forks: 64
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-wp-developer-tools - Yeoman WordPress Plugin Generator - Yeoman generator for WordPress plugins. (WordPress Plugins)
README
# generator-plugin-wp [![buddy pipeline](https://app.buddy.works/webdevstudios/generator-plugin-wp/pipelines/pipeline/226897/badge.svg?token=2471ae60766a1e9a657f772e493188dde748aa18c236d0b1c325e80be13a2ac6 "buddy pipeline")](https://app.buddy.works/webdevstudios/generator-plugin-wp/pipelines/pipeline/226897)
> [Yeoman](http://yeoman.io) generator for WordPress plugins.
## Getting Started
Pre-requisites: You'll need [node](https://nodejs.org/download/) which comes
with [npm](https://github.com/npm/npm#super-easy-install).If you don't have [Yeoman](http://yeoman.io/) installed:
```bash
npm install -g yo
```To install generator-plugin-wp from npm, run:
```bash
npm install -g generator-plugin-wp
```To use generator-plugin-wp, `cd` to your WordPress plugins folder and:
```bash
yo plugin-wp
```
You'll be prompted with steps for creating your plugin.## Sub-generators
Once your nifty new plugin has been generated, `cd` into your new plugin's
directory. While in the plugin directory, you can run additional commands
called sub-generators to automatically generate files to enhance your plugin.* `yo plugin-wp:include ` [Basic Include](include/README.md)
* `yo plugin-wp:cpt ` [Custom Post Type](cpt/README.md)
* `yo plugin-wp:cli ` [WP CLI Command](cli/README.md)
* `yo plugin-wp:taxonomy ` [Taxonomy](taxonomy/README.md)
* `yo plugin-wp:options ` [Option Page](options/README.md)
* `yo plugin-wp:widget ` [Widget](widget/README.md)
* `yo plugin-wp:endpoint ` [WP-API Endpoint](endpoint/README.md)
* `yo plugin-wp:js` [Javascript](js/README.md)
* `yo plugin-wp:css` [Styles](css/README.md)For the names of the include, cpt, options, and widget subgenerators remember
that the plugin prefix will be added to the class name so no need to include the
original plugin name there. Think of it as the file name for each instead.## Tests
By default the plugin generator adds some built in tests for you to add on to as
you develop your plugin. To run these tests run the `install-wp-tests.sh` script
in the bin folder with the proper database details for your local setup.Once you've run the `install-wp-tests.sh` script you can run just `phpunit` in
the main folder of your plugin.If you don't want tests included in your plugin when it is generated run the
main generator with the `--notests` option.## PHP 5.2
By default PHP 5.2 is not supported in the generated plugin. To generate a plugin
with PHP 5.2 support, run the main generator with the `--php52` option.## CMB2
CMB2 is included by default with the options sub-generator. It can also be a useful tool with CPT and taxonomy sub-generators using the --cmb2 flag.## Adding Packages with Composer
If you chose composer as the autoloader option during the plugin's initiation,
you can use composer to add additional dependencies.Let's `cd` into our new plugin's directory and add [CMB2](https://github.com/CMB2/CMB2):
```bash
composer require cmb2/cmb2
```CMB2 will now appear under `vendor`
```bash
-plugins
-wds-foo-plugin
-vendor
-cmb2
-cmb2
```## Contributors
The following humans contributed to this awesome generator:![](https://avatars1.githubusercontent.com/u/804253?v=3&s=20) [CamdenSegal](https://github.com/CamdenSegal), ![](https://avatars0.githubusercontent.com/u/1098900?v=3&s=20) [jtsternberg](https://github.com/jtsternberg), ![](https://avatars2.githubusercontent.com/u/991511?v=3&s=20) [jazzsequence](https://github.com/jazzsequence), ![](https://avatars1.githubusercontent.com/u/16279215?v=3&s=20) [binarygary](https://github.com/binarygary), ![](https://avatars1.githubusercontent.com/u/66798?v=3&s=20) [bradp](https://github.com/bradp), ![](https://avatars3.githubusercontent.com/u/720377?v=3&s=20) [JeffreyNaval](https://github.com/JeffreyNaval), ![](https://avatars1.githubusercontent.com/u/200280?v=3&s=20) [gregrickaby](https://github.com/gregrickaby), ![](https://avatars0.githubusercontent.com/u/1777519?v=3&s=20) [DevNIX](https://github.com/DevNIX), ![](https://avatars2.githubusercontent.com/u/871924?v=3&s=20) [JPry](https://github.com/JPry), ![](https://avatars2.githubusercontent.com/u/2522431?v=3&s=20) [RC Lations](https://github.com/rclations), ![](https://avatars2.githubusercontent.com/u/796639?v=3&s=20) [tnorthcutt](https://github.com/tnorthcutt), ![](https://avatars2.githubusercontent.com/u/1753298?v=3&s=20) [aubreypwd](https://github.com/aubreypwd), ![](https://avatars2.githubusercontent.com/u/6805601?v=3&s=20) [JeffMatson](https://github.com/JeffMatson)