This boilerplate attempts to cut down on the number of repetitive steps needed to get a solid WordPress plugin up and running.
With this bootstrapping approach you no longer have to write code that does the following:
- Add the plugin version number to the database (activation)
- Remove the plugin version number from the database (de-activation)
- Creates admin-tags.php (auto included)
- Creates template-tags.php (auto included)
- Creates functions.php (auto included)
- Creates style.css (auto registered)
- Creates script.css (auto registered)
- Creates a readme.txt (template)
Note the file structure and naming convention is based solely on the WordPress
directory structure. With the exception of wp-includes/
being shorten to inc/
and losing the prefix.
This plugin derives your Plugin Version Number and Plugin Name from your WordPress Plugin File Headers.
- Dynamically adds the Plugin Version Number to the WordPress options table on activation
- Removes the Plugin Version Number from the WordPress options table on de-activation
- Dynamically includes useful files if they exists:
- functions.php // Shared functions between admin and templates
- admin-tags.php // Functions used only on the WordPress admin
- template-tags.php // Functions used only in WordPress themes
- Download to wp-content/plugins/
- Rename the folder
zm-plugin-bootstrap/
to the name of your plugin - Open the file plugin.php
- Edit the plugin headers, i.e., Name, Version, Description, etc.
- Open functions.php add shared code between the admin and theme
- Open admin-tags.php add code only to be used on the admin
- Open template-tags.php add code to be used only by the theme ** When the plugin is deactivate the entry for the version number will be removed. **
- WordPress (Latest)
Fork, Pull, Star, Add Issues, etc.
Zane Matthew
Copyright 2013 Zane Matthew
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA