Feature
Post

Category
General


How to Write a WordPress Plugin – Introduction

How To Write a WordPress Plugin Series

This post was written as part of the How to Write a WordPress Plugin series.

For any WordPress user, plugins are essential. WordPress Plugins allow those with little to no programming skills to extend the functionality of their blog. Plugins come in all shapes and sizes, and there is a plugin that does just about anything for WordPress.

As good as WordPress is as a standalone application, there are still things that WordPress lacks. Users are requesting more and more features for WordPress that would be very feasible to write as a plugin. There are many untapped ideas out there, and new ones created every day.

Having released three plugins already (not counting the custom ones I wrote), I am aware of some of the limitations of WordPress and wish to share some of the lessons I have learned (and am still learning) about creating WordPress plugins. As a result, I will be starting series that will discuss various topics regarding writing your own WordPress plugin. The series will start off very introductory and will assume your plugin knowledge is zilch.

Who is this Series For?

This series is for any WordPress user who is curious about or wants to learn how to write their own WordPress plugin. Readers of this series will have an intermediate knowledge of PHP, know a little JavaScript, and be decent at Cascading Style Sheets.

This plugin series will benefit theme designers, those that like to tinker with plugin code, and those that are interested in writing their own plugin from scratch.

Tools to Get the Job Done

To write plugins, any text editor will do. Here are the tools I personally use to create plugins.

This series assumes you have WordPress 2.1.x or greater installed.

Code Samples

All code I use will be available for download after each post in the Conclusion section. I will be building the code as I go along, so each download will be different. I will be creating a plugin that doesn’t really do anything other than to show you the basics of how a plugin works.

Since each post in this series builds on top of each other, it is recommended to read this series in the order it is presented.

I highly recommend not using the test plugin on a production WordPress installation. Instead, use a local WordPress installation.

Topics

I plan to start off really basic and move quickly into the more hard-core WordPress plugin functions. This series will not be a comprehensive micro-detail of plugin development, but will hopefully give you a nice foundation to start your own plugin development. If you have any questions or suggestions, please leave a comment or e-mail me using the Devlounge contact form (Ronald). I do ask that you not rely on Devlounge for support and instead use the WordPress Support forums.

Techniques

Some of the techniques I use in my code samples may not be the best way to present code and you may be cringing because I don’t have a lot of shortcuts. I apologize in advance. Everybody has a different coding style.

As far as plugin techniques, structure, behavior, and other nuisances, if there is a better and easier way that I overlooked, I am all ears (er, eyes).

Series Publication Schedule

A post from this series is planned to be published every two days. To stay up to speed on the series, I suggest you subscribe to the Devlounge feed.

Conclusion

Thank you for reading the series introduction. My hope is that this series will prove beneficial to the readers. Any feedback is welcome. Thank you.


  1. By Pet Snakes posted on May 27, 2009 at 12:33 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Love your writing style and the design of your blog, its very original! Well done, look forward to reading more.

  2. By babu posted on June 20, 2009 at 10:09 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Hey Ron,

    I was wondering if you could hep me with a simple code for my plugin, I just started to develop one. All I want is to create a post and then add its link to my home page.

  3. By china wholesale posted on July 16, 2009 at 7:13 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Can you provide more information on this?

  4. By John Bonds posted on July 19, 2009 at 4:47 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Thank you. I bookmark you blog!

  5. By Emily posted on July 29, 2009 at 8:28 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Im having a lot of trouble with your blog loading lately. Intermittant, and goes to a page could not be found every so often. Hope there isnt any problems.

  6. By Radu posted on September 15, 2009 at 10:07 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Nice and straight introduction in wordpress plugins!
    Thanks… will make my development easier.

    Can you add also a tutorial explaining how one can debug a plugin using the tools that you mentioned?

  7. By learn css posted on September 16, 2009 at 8:16 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Great Info…. Thanks

  8. By Eric Zhu posted on October 20, 2009 at 2:12 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I think the comment may give me a good sense to know more about above subject.

  9. By wholesalers china posted on November 7, 2009 at 6:55 am
    Want an avatar? Get a gravatar! • You can link to this comment

    thanks, this is definitely what I need for my new website

  10. TrackbackHow to Write a WordPress Plugin Introduction Devlounge | Wood TV StandEssential Wordpress Plugin Development Resources, Tutorials and Guides : Speckyboy Design Magazine20 Tutorials to Develop Wordpress Plugin |