Step 10 – Plugin Hierarchy
Steps to Create a WordPress Plugin
- Name Your WordPress Plugin
- Isolate Your Plugin From Other Plugins
- Organize Your Plugin Files
- Define Directory Paths
- Load Plugin Files
- Directory Structure
- Plugin Activation, Plugin Deactivation, and Plugin Uninstallation
- Essential Plugin Files
- Security: Protect Plugin Files
- Plugin Hierarchy
Just to summarize everything, the end result is your plugin structure should look similar to the following outline:
If you read through all of the steps in this tutorial on how to create a WordPress plugin and practiced this with your own plugin name; You should have a very good start on your plugin. This tutorial wasn’t meant to produce a plugin that actually does anything. It’s more or less just a plugin skeleton or plugin boiler plate template, which you can use for pretty much ANY WordPress plugin. The idea here is to get you going with WordPress plugin development practicing: organization, simplicity, isolation, and consistency.
I purposely didn’t include a simple
.zip download of these files or a gist because I want you to actually read, and follow along. I feel like you’ll obtain much more of an understanding about creating a WordPress Plugin if you assemble this bits and pieces step by step. If you just download and search/replace, that doesn’t really teach you much.
I thought it would be helpful to include a list of useful resources to accompany some of the functionality used to compose this plugin shell.
- WordPress Plugin Development Handbook
- WordPress Plugin Development Codex
- WordPress Plugin API
- WordPress Coding Standards
- WordPress Hooks
- WordPress Action Hooks
- WordPress Filter Hooks
- PHP Namespaces
- FAQ: things you need to know about namespaces
- PHP Callback Functions
- PHP Anonymous Functions
- PHP Constants
- PHP Magic Constants
- WordPress Hooks Database
- Advanced WordPress Hooks
I’d love to hear what you think of this WordPress plugin development tutorial in the comments. If there’s any portion of this WordPress tutorial that lacks detail or seems unclear, please let me know. The odds are: if you feel that way, someone else probably does too.
If you enjoyed this article, please subscribe to my blog. I try to post educational / informative information about WordPress and much of what relates to Web Design and Website Development in general.