mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 20:03:53 +02:00
parent
0d968d2c20
commit
945b5a1bd4
1 changed files with 25 additions and 23 deletions
48
README.md
48
README.md
|
@ -1,35 +1,35 @@
|
||||||
|
|
||||||
# WordPress Plugin Boilerplate
|
# WordPress Plugin Boilerplate
|
||||||
|
|
||||||
The WordPress Plugin Boilerplate serves as a foundation and aims to provide a clear and consistent guide for building your WordPress plugins.
|
The WordPress Plugin Boilerplate serves as a foundation and aims to provide a clear and consistent guide for building your WordPress plugins.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* The Plugin Boilerplate is fully-based on the WordPress [Plugin API](http://codex.wordpress.org/Plugin_API)
|
* The Plugin Boilerplate is fully-based on the WordPress [Plugin API](http://codex.wordpress.org/Plugin_API).
|
||||||
* Uses [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) conventions for easily following the code
|
* Uses [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) conventions to document the code.
|
||||||
* Liberal use of `TODO` to guide you through what you need to change
|
* Example values are given, so you can see what needs to be changed.
|
||||||
* Uses a strict file organization scheme to make sure the assets are easily maintainable
|
* Uses a strict file organization scheme to make sure the assets are easily maintainable.
|
||||||
* Note that this boilerplate uses `plugin.po` to provide a translation file. This is compatible with [POEdit](http://www.poedit.net/)
|
* Note that this boilerplate includes a `.pot` as a starting translation file.
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
The WordPress Plugin Boilerplate includes the following files:
|
The WordPress Plugin Boilerplate includes the following files:
|
||||||
|
|
||||||
* This `README`
|
* This README, a ChangeLog, and a `gitignore` file.
|
||||||
* A subdirectory called `plugin-boilerplate`
|
* A subdirectory called `plugin-name`
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
1. Copy the `plugin-boilerplate` directory into your `wp-content/plugins` directory
|
1. Copy the `plugin-name` directory into your `wp-content/plugins` directory
|
||||||
2. Navigate to the *Plugins* dashboard page
|
2. Navigate to the *Plugins* dashboard page
|
||||||
3. Locate the menu item that reads *TODO*
|
3. Locate the menu item that reads *Plugin Name*
|
||||||
4. Click on *Activate*
|
4. Click on *Activate*
|
||||||
|
|
||||||
This will activate the WordPress Plugin Boilerplate. Because the Boilerplate has no real functionality, nothing will be added to WordPress; however, this demonstrates exactly how your plugin should behave as you're working with it.
|
This will activate the WordPress Plugin Boilerplate. Because the Boilerplate has no real functionality, nothing will be added to WordPress; however, this demonstrates exactly how your plugin should behave while you're working with it.
|
||||||
|
|
||||||
If you opt to uncomment Line 77 which contains the following line:
|
A new menu item will be added to the *Plugins* menu if you uncomment Line 71 in the class file which contains the following line:
|
||||||
|
|
||||||
`add_action( 'admin_menu', array( $this, 'plugin_admin_menu' ) );`
|
`add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );`
|
||||||
|
|
||||||
Then a new menu item will be added to the *Plugins* menu.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
@ -52,18 +52,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
### Licensing
|
### Licensing
|
||||||
|
|
||||||
The WordPress Plugin Boilerplate is licensed under the GPL2+ or later; however, if you opt to use third-party frameworks
|
The WordPress Plugin Boilerplate is licensed under the GPL v2 or later; however, if you opt to use third-party code that is not compatible with v2, then you may need to switch to using code that is GPL v3 compatible.
|
||||||
such as [Bootstrap](http://twitter.github.io/bootstrap/) in your work, then you should be aware of this:
|
|
||||||
|
|
||||||
> The most likely occurrence of this issue is with Themes developed using Twitter Bootstrap. When reviewing such Themes, please be sure to check that, if the Theme is licensed under GPL, that the license specifies either unversioned GPL, or GPLv3.0.
|
For reference, [here's a discussion](http://make.wordpress.org/themes/2013/03/04/licensing-note-apache-and-gpl/) that covers the Apache 2.0 License used by [Bootstrap](http://twitter.github.io/bootstrap/).
|
||||||
|
|
||||||
For reference, [here's the full conversation](http://make.wordpress.org/themes/2013/03/04/licensing-note-apache-and-gpl/).
|
|
||||||
|
|
||||||
## Assets
|
## Assets
|
||||||
|
|
||||||
The assets directory provides two files that are used to represent plugin header images.
|
The assets directory provides two files that are used to represent plugin header images.
|
||||||
|
|
||||||
When committing your work to the WordPress Plugin Repository, these files should reside in their own `assets` directory, not in the root of the plugin. The initaly repository will contain three directories:
|
When committing your work to the WordPress Plugin Repository, these files should reside in their own `assets` directory, not in the root of the plugin. The initial repository will contain three directories:
|
||||||
|
|
||||||
1. `branches`
|
1. `branches`
|
||||||
2. `tags`
|
2. `tags`
|
||||||
|
@ -76,8 +73,13 @@ You'll need to add an `assets` directory into the root of the repository. So the
|
||||||
3. `tags`
|
3. `tags`
|
||||||
4. `trunk`
|
4. `trunk`
|
||||||
|
|
||||||
Next, copy the contents of the `assets` directory that are bundled with the Boilerplate into the root of the repository. This is how the WordPress Plugin Repository will retrieving the plugin header image.
|
Next, copy the contents of the `assets` directory that are bundled with the Boilerplate into the root of the repository. This is how the WordPress Plugin Repository will retrievie the plugin header image.
|
||||||
|
|
||||||
Of course, you'll want to customize the header images from the place holders that are provided with the boilerplate.
|
Of course, you'll want to customize the header images from the place holders that are provided with the Boilerplate.
|
||||||
|
|
||||||
For more, in-depth information about this, read [this post](http://make.wordpress.org/plugins/2012/09/13/last-december-we-added-header-images-to-the/) by Otto.
|
For more, in-depth information about this, read [this post](http://make.wordpress.org/plugins/2012/09/13/last-december-we-added-header-images-to-the/) by [Otto](https://twitter.com/Otto42).
|
||||||
|
|
||||||
|
Plugin screenshots can be saved to one of two locations:
|
||||||
|
|
||||||
|
* The traditional location is to keep them in the root of the plugin directory. This will increase the size of the download of the plugin, but make the images accessible for those who install it.
|
||||||
|
* Alternatively, you can save the screenshots in the `assets` directory, as well. The repository will look here for the screenshot files as well; however, they will not be included in the plugin download thus reducing the size of the plugin.
|
Loading…
Reference in a new issue