This is a boilerplate WordPress plugin featuring namespace autoloading and Carbon Fields examples. It is intended to be used as a starting point for creating WordPress plugins. It contains several examples and dependencies to get you started.
It may also be used as the means of separating custom code from the theme or extending a child theme.
Here are some ways that you can contribute:
- Suggest improvements and/or code them.
- Test the translation mechanisms - they have not been extensively tested yet.
- Report bugs and/or incompatibilities
- Namespaces & dependency autoloading
- Version checking (PHP, Carbon Fields)
- Powered by Composer, Gulp and Bower
- Object caching (where available; usage examples)
- Easy installable ZIP file generation:
npm run zip
- Automatic translation file (
.pot
) creation. See Translation. - Shortcodes, widgets (via Carbon Fields) and custom post types (via PostTypes) examples
- Configuration registry (docs) and optional
wp-config.php
constants - Customizer options
- More to come...
Note: Gulp and Bower are optional, but handy. If you do not wish to use them, you can delete the references.
- WordPress 4.6 or higher
- PHP 5.6 or higher
- Carbon Fields 2.0 or higher (see the wiki section Carbon Fields for more info).
If you need tips on installing Node.js, Composer, Gulp & Bower, see Installing Dependencies.
- Clone repository to your
plugins
directory - Change the four variables in package.json
- Run
npm install; gulp rename; composer install
- At command prompt, change to your
wp-content/plugins
directory. - Clone the repository:
git clone https://github.com/dmhendricks/wordpress-base-plugin.git
- Renamed the newly created
wordpress-base-plugin
directory to your own plugin slug.
See the Getting Started documentation for further steps.
- Refactor the Plugin and Loader classes
- Add plugin uninstall hook
- Add support for Gulp 4.0
- Add phpdotenv support
- Switch to npm and WebPack for frontend dependency management
Release changes are noted on the Releases page.
- Extended base class as WordPress Toolkit
- Moved
is_ajax()
andprefix()
methods to wordpress-toolkit - Updated Composer license to conform to new SPDX identifiers