Git Product home page Git Product logo

generator-plugin-wp's Introduction

generator-plugin-wp buddy pipeline

Yeoman generator for WordPress plugins.

WebDevStudios. WordPress for big brands.

Getting Started

Pre-requisites: You'll need node which comes with npm.

If you don't have Yeoman installed:

npm install -g yo

To install generator-plugin-wp from npm, run:

npm install -g generator-plugin-wp

To use generator-plugin-wp, cd to your WordPress plugins folder and:

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.

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:

composer require cmb2/cmb2

CMB2 will now appear under vendor

-plugins
  -wds-foo-plugin
    -vendor
      -cmb2
        -cmb2

Contributors

The following humans contributed to this awesome generator:

CamdenSegal, jtsternberg, jazzsequence, binarygary, bradp, JeffreyNaval, gregrickaby, DevNIX, JPry, RC Lations, tnorthcutt, aubreypwd, JeffMatson

generator-plugin-wp's People

Contributors

asharirfan avatar aubreypwd avatar binarygary avatar blobaugh avatar bradp avatar camdensegal avatar daveromsey avatar devnix avatar e-baker avatar gregrickaby avatar jazzsequence avatar jeffmatson avatar jeffreynaval avatar jpry avatar jtsternberg avatar kellenmace avatar phatsk avatar rclations avatar tnorthcutt avatar websupergirl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.