/wp-plugin-boilerplate

A WordPress plugin boilerplate for Masonite with recommended settings for VS Code.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

WP Plugin Boilerplate

A WordPress plugin boilerplate for Masonite with recommended settings for VS Code. This plugin enforces Masonite coding standards for scss, js, & php via linting during the build process as well as through local git hooks.

Requirements

  • PHP >= 7.3
  • Git for version control
  • Composer for managing PHP dependencies
  • Node 8+
  • NPM (Packaged with Node)

Setup

Feel free to download the boilerplate or you may run the following command that will prompt you for your new plugin's information:

npx @masonite/create-wp-plugin

VS Code

The plugin provideds a recommended set of settings for Visual Studio Code. In order to see inline errors, it is recommended that you install the following extensions:

This plugin contains numerous configuration files that you will either never need to edit or rarely edit. Because of this, the following extension is also recommended.

Internationalization

For the text in the plugin to be able to be translated easily the text should not be hardcoded in the plugin but be passed as an argument through one of the localization functions in WordPress.

How to Internationalize Your Plugin →

This plugin contains a ready to go .pot can be found within languages/. This file can be updated using the following command:

npm run i18n

License

This plugin is licensed under GNU General Public License v2 (or later).