This plugin is designed to be used as starting point for a new plugin. It will save you the time of putting in place a file structure, adding common files, creating a basic plugin class, wiring common hooks that you might need, adding an admin menu item, and more. It uses many common, standard WordPress techniques for frequently needed basic plugin features. It is well commented with TODO items to know where to customize it for your own needs.
How to Use this Plugin Template
- Copy the entire folder to a new location and folder that you rename for your new plugin.
- Rename any of the files in the structure that you want to "re-brand" for your plugin and make sure any code references pointing to those files are also updated.
- Go through the code and follow the well-commented TODO items, renaming the class and variables and functions to suit your needs.
- Add your own core functionality / graphics / etc.
- If you have a lot of common things that you do from plugin to plugin, add those to your main "template" version and they will be available every time you copy it to a new plugin.
Important Notes
- This plugin includes examples of how we implement a plugin sidebar in our own plugins and exmple widgets like our own mail-chimp newsletter subscription, etc.
- You will have to either know how to modify these for your own needs or remove them completely.
- We cannot promise support for specific questions about what to modify in your scenario.
Enjoy!
Features
Example techniques included in this Plugin Template
- General file structure
- Lots of comments and TODO items to help you know what to change
- Using a class approach to building a plugin
- Minimal variable updates by re-using class level variables for things like the plugin name and slug
- Using common WordPress hooks and filters
- Creating an admin menu item under the Settings menu
- Implementing the WordPress Settings API
- Very basic responsive settings page including a banner
- Creating a Sidebar that has its own widget system and can pull data from a feed on your WordPress site (this is more of an advanced feature that we use on our own plugins and it requires additional know-how to tweak for your needs). It can also be removed completely if you don't need / want it.