2017 © Pedro Peláez
 

wordpress-plugin torro-forms-plugin-boilerplate

Plugin Boilerplate for Torro Forms.

image

awsmug/torro-forms-plugin-boilerplate

Plugin Boilerplate for Torro Forms.

  • Monday, July 2, 2018
  • by mahype
  • Repository
  • 4 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status Code Climate Test Coverage Latest Stable Version License, (*1)

Torro Forms Plugin Boilerplate

This is a plugin boilerplate for a Torro Forms extension. It is highly encouraged to use this boilerplate when building any extension for Torro Forms., (*2)

Getting Started

To create your own plugin, download this repository. For the next steps, let's assume your plugin should be called Torro Super Extension., (*3)

  1. Rename the directory to torro-super-extension.
  2. Rename the plugin main file to torro-super-extension.php.
  3. Open gulpfile.js and scroll to the bottom.
  4. Replace every value in the replacements object with your new plugin name or plugin author data in the appropriate format. For example, replace my-new-plugin-name with torro-super-extension, MY_NEW_PLUGIN_NAME with TORRO_SUPER_EXTENSION and so on. Replace the plugin namespace vendor, plugin URL, author name, author email and author URL with your respective data.
  5. Save the changes.
  6. Run npm install in the console.
  7. Run gulp init-replace in the console.
  8. Open gulpfile.js again and remove the entire bottom section that starts with INITIAL SETUP TASK, save the file afterwards.
  9. Check the composer.json and package.json files. You might wanna update some details to your preferences.
  10. Check the top of gulpfile.js, containing the config object. You might wanna update some details to your preferences.
  11. Run gulp build once to compile everything.

Now you're good to go! One more thing: If you want to publish the plugin on wordpress.org, it's recommended to remove the /languages directory, plus set the config.domainPath to false and remove the pot task in gulpfile.js. Then, remove the now unnecessary arguments from the Extension::load_textdomain() method accordingly., (*4)

Actual Development

Adjust the src/extension.php file to your needs. This is where your extension will get bootstrapped. You can instantiate the services your extension needs here, setup hooks (which will then be automatically invoked by the Torro Forms main plugin) and more., (*5)

All further classes and assets in the boilerplate is optional and simply sample code. Just bear in mind, you should stick to the directory structure used in the boilerplate - it is oriented after the Torro Forms base plugin., (*6)

Common Gulp Tasks

  • gulp sass: Compiles CSS/Sass
  • gulp js: Compiles JavaScript
  • gulp pot: Refreshes POT file
  • gulp header-replace: Replaces the plugin header with latest data
  • gulp readme-replace: Replaces the header and description in the readme with latest data
  • gulp build: Runs all of the above tasks

The Versions

02/07 2018

dev-api-action

dev-api-action https://plugin-website.com

Plugin Boilerplate for Torro Forms.

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

plugin wordpress api extension forms form builder torro forms

17/04 2018

dev-master

9999999-dev https://plugin-website.com

Plugin Boilerplate for Torro Forms.

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

plugin wordpress api extension forms form builder torro forms

07/03 2018

1.0.0

1.0.0.0 https://plugin-website.com

Plugin Boilerplate for Torro Forms.

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

plugin wordpress api extension forms form builder torro forms