How to write your own WordPress Plugin
WordPress Plugin A WordPress plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress Plugin Application Program Interface (API). So, if you find yourself wishing that WordPress had some new or modified functionality, the first thing to do is to search various plugin repositories (which you can learn about in the Plugins article), and see if someone has already created a plugin that suits your needs. If not, this article will guide you through the process of creating your own plugins. For today’s exercise (which will take me no more than an hour to explain in writing), we’re going to make a plugin that is like the acronym plugin, except it’s going to display an image popup instead of text. To begin, you’re going to need a text editor. I recommend one of the syntax-highlighting variety. My commercial editors of choice at the moment are TextPad or EditPad Pro. Notepad doesn’t syntax-highlight, but it works fine. Macintosh users are on their own with this, but I’ve heard the word BBEdit uttered more than once. Whatever you use, open a blank file. The first thing to do is to name and document the plugin so that it appears in the WordPress administration console. We’re going to call our plugin “AcroPop”. The plugin header tells WordPress what to do with the plugin file. Insert something to this effect at the top of your plugin file, placing the appropriate information in the appropriate fields:
Some notes about the plugin header: All of the header info is inside of a block comment. That’s because none of it is executable. WordPress scans the plugins directory for files that contain this header information. When it finds the headers, it includes the plugin file. No header, no include. The Plugin URI is the URI of the plugin, where users can expect to find a link to the latest downloadable version. The Author URI is the URI of your site, where users can find out more information about the person in the Author field.
October 25th, 2006 at 12:33 am
Hi, this is a comment.
To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them.