Writing One Really Simple WordPress Plugin
- Posted On: July 13th, 2006
- Filed Under: Web Design
- Tagged As: Code, WordPress
Declaring the Function
Once a plugin is activated, using it requires calling one or another function from within it. If you're familiar with average WordPress tags you'll know what I mean. Adding
It's really simple and its really powerful but, "with great power comes great responsibility." It's very important when you setup your plugin that you don't duplicate an existing function name. Following the WordPress Codex suggestions you can start by using your own initials, or (as I like to do) the acronym for your site. There are other methods to safely accomplish this but we're going dead simple so we'll cover those later.
We'll use the prefix rotw_ (Return of the Whatzit) here:
the functionfunction rotw_showAd() {
// next step will go here
}
From there we add the important stuff.



The necessary plugin (:
- JimyIt is established easily and perfectly works.
Thank u so much!