To use this plugin template, add it to your WordPress plugins directory and activate it from the Plugins page. Then take a quick moment to see how the plugin works. There are three components to the plugin that you should try out before you start looking at the code.
- First, go to the visitor facing side of your website. You’ll notice a “Fact Check” form at the bottom of each post. This bit is intended to demonstrate AJAX form submission from the visitor facing pages.
- Next, go to the admin side of the website. Under the Settings tab, click B2 Template Plugin. This bit shows how to save plugin settings the normal way, how to save data using AJAX from the admin pages, and also demonstrates how internationalization works.
- Finally, go to the Widgets page under the Appearance tab. Here you’ll see a Widget called B2 Template Widget. Drag this into one of your sidebars and experiment with the different settings. Then go to the visitor facing pages of your website and have a look at how this widget works.
Once you’ve examined these parts of the Plugin, open up the file B2Template.php and begin reading through the well commented code. If you have any questions please visit our blog at http://bloggingsquared.com or contact the developer directly by emailing email@example.com.
I hope this helps you on your way to becoming a WordPress plugin guru!
Blogging Squared provides high quality custom WordPress themes and plugins for individuals and businesses at competitive rates. Contact us at firstname.lastname@example.org to request a quote.
- Upload the folder
- Activate the plugin through the ‘Plugins’ menu in WordPress
Contributors & Developers
“B2Template” is open source software. The following people have contributed to this plugin.
- Initial version of the plugin
- Completely refactored plugin to have a more logical class structure.
- Complete separation of html, php, js and css.
- Added more detailed comments to facilitate learning
- Added template for WordPress 2.8 and up style widgets
- Fixed bug where wordpress activation and deactivation hooks didn’t work on some machines. Now using preffered register_activation_hook and register_deactivation_hook methods
- Fixed bug where widget options did not update.
- Fixed bug where RouteActions would throw a warning
- Moved update plugin script out of the activation function, since this behaviour is improper and no longer supported. Activating function is only for initial installation, Update function is run on each page load
- Fixed broken $.ajax jQuery calls resulting from upgrade to jQuery 1.4. The type:’post’ had to be declared first in the object properties
- Cleaned up handling of ajax / non-ajax actions
- Tested compatibility with WordPress 3.1.1