Jumping Into WordPress Plugin Programming

WordCamp Birmingham 2009In a few weeks, I will be a presenter at WordCamp Birmingham 2009 (that’s Birmingham, Alabama, not England, by the way). Last year, I did a presentation on “The Future of WordPress“, shortly before the release of version 2.7. I briefly considered doing the same thing this year, updated with speculation about the upcoming versions 2.9 and 3.0, but that seemed like a cop-out. I wanted to do something a little deeper.

One of the things that always frustrates me about starting to work with a new programming language, or with a new framework for a language I already know, is the initial learning curve. Everybody wants to start out with the ubiquitous “Hello, World” example, which is great for a quick syntax example, but is pretty useless for practical purposes. I always want a good primer which doesn’t assume I’m a complete beginner, and dives right into useful examples. I want to know how to find the existing pieces of the system that are going to make my life easier. So I thought others might appreciate something like that for WordPress plugin programming.

So that’s going to be my presentation topic this year. I’m going to try to create an introduction to creating plugins for WordPress. While there are bits of the process that can be complex, the real meat of the API hooks (filters and actions) are really pretty simple. And I think that with a good overview, those who aren’t already familiar with programming for WordPress can get up-to-speed more quickly than if they had to discover everything by searching the web and using trial-and-error. While I will try to keep things as simple as possible, I’m going to assume that my target audience will at least have a basic knowledge of programming concepts to include what functions and arrays are. You won’t have to be a PHP expert, or even be able to sit down and write a program from scratch without a reference book handy.

I will, of course, make the presentation available online when the WordCamp arrives. And since I’ll be limited by time in my presentation, I’d like to publish an expanded version here later as a series of articles where I can go into more depth.

I’ve already started a rough outline of what I want to cover. But I’d welcome any ideas or questions on this topic. If you are already familiar with programming, but you’re new to programming in the WordPress framework, what questions have you had? What concepts confuse you? What areas would you like to see covered?

Stumble It!
Jumping Into WordPress Plugin Programming

Related posts:

  1. Jumping into WordPress Plugin Development presentation
    "Despite an extreme lack of sleep, I managed to make it through my WordCamp Birmingham presentation this morning on Jumping into WordPress Plugin Programming. I..."
  2. Getting ready for WordCamp Birmingham 2009
    "In a short while, I’ll be leaving Atlanta, and heading west to Alabama for WordCamp Birmingham 2009. I’m giving a presentation on Saturday morning about..."
  3. I’m speaking at WordCamp Atlanta
    "I’m pleased to announce that I will be speaking at WordCamp Atlanta next month. I will be presenting an updated version of the Jumping Into..."
  4. WordCamp Birmingham
    " If you haven’t already heard, WordCamp Birmingham is coming up on September 27 & 28, 2008. And for those of you not in the..."
  5. WordPress Webhooks Plugin
    "Check out this demo video of a new plugin by mitcho, called HookPress. HookPress adds the ability to use webhooks as WordPress actions and filters...."
This entry was posted in WordPress and tagged , , , , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

14 Comments

  1. scribu scribu.net
    Posted August 16, 2009 at 9:41 am | Permalink

    Hello,

    First of all, great presentation ideea.

    What really confused me after learning about hooks was how to use the wp_enqueue_script() family of functions.

    • Dougal dougal.gunters.org
      Posted August 17, 2009 at 12:59 pm | Permalink

      I think that the enqueue functions might be beyond the scope of my WordCamp presentation. But they will definitely be mentioned as ‘best practice’ examples when I do the expanded series of articles.

  2. Posted August 17, 2009 at 6:39 am | Permalink

    One year ago wp 2.6 was released ! since then 11 releases !!!

    Sure 2.7 was a great release with the new admin UI.
    2.8 was also a great plugin ‘breaker’ with the javascript libraries under admin going from top of the page to bottom…

    About plugins, each new wp version release requires a plugin review and most of the time an update.
    It is quite true when your plugin has one or several admin pages.

    I believe that – something like – reengineering core wp admin pages as admin plugin pages, giving by the way a whole set of skeletons/classes/api would :
    * make the learning curve shorter for new comers to build their own plugin admin pages,
    * encourage the stability of code (less wp release dependant),
    * immediately make some wp admin pages options / api’s available for plugins :
    – have to dig hard in wp code to see how customize the “screen options” or “help” tabs;
    – making easier use of facilities such as roles/capabilities + menus, register/enqueue styles and scripts …,
    * give more time on plugin core functions.

    An example : in one of my plugin having some custom admin pages, “show on screen” options (for meta box and columns) was working correctly under 2.7, but not under 2.8

    hope this help !

    • Posted August 17, 2009 at 7:15 am | Permalink
    • Dougal dougal.gunters.org
      Posted August 17, 2009 at 1:13 pm | Permalink

      If I understand you correctly, you’re suggesting some core functions that would make it easier for plugins to create settings pages, right? If so, I had a similar idea a while back, and I *thought* I had seen some Trac tickets that led me to believe that we might be heading in that direction.

      For simple plugin settings pages, it shouldn’t be hard to add. We just need some functions that allow us to declare a settings page, add sections to it, add forms within the sections, add fieldsets within the forms, and add text and forms fields within the fieldsets. And finally, an easy way to handle the form submission results.

      Once upon a time, back in the very early days of WordPress, much of the back-end settings were handled similar to that. The options were all defined in the database with fields defining how the settings were grouped, the data types of the settings, and descriptions for them. Then the options rendering code dynamically built the forms.

      If they were going to make a dynamic way to create plugin settings pages, that old code could be a good starting point. Though in this case, instead of building things up based on information in the database, you’d set it up in your plugin code, and we’d probably want to do it in an OOP fashion, with some flexible utility classes.

      • Posted February 10, 2010 at 11:46 pm | Permalink

        Thanks for the headsup, I’ve only worked with the php code in themes for older versions. I do like how they migrated to a much simpler format for plugins. I really wanted to create a WP plugin but I fear that most of the ideas that I have are already been created.

        I want to create something that people will actually use, and it seems like the plugin market is oversaturated. Would you agree with that sentiment?

  3. Mas Dhani ict-learningnow.com
    Posted September 28, 2009 at 1:19 am | Permalink

    Great plugin

  4. dugun salonu dugun-salonu.com
    Posted October 15, 2009 at 2:06 pm | Permalink

    Jumping Into WordPress Plugin is perfect. thank you by dougal

  5. Svetainiu Kurimas prontanet.lt
    Posted October 19, 2009 at 3:16 am | Permalink

    Went through the first 12 slides of the presentation (dont have the time for the entire show) I have to say I was impressed by the conciseness of teh slide text and the comparisons (filters in photography and photoshop!) I use DIY Theme in Wordpress and have messed about with hooks but never really put time into it and I cant say I understand the workings. I will go through your presentation on the weekend though – maybe that will start the process!

  6. abrcity abrcity.com
    Posted November 1, 2009 at 5:04 pm | Permalink

    i think we should learn the php and xml really good,then we should take a deep look at the wp code

  7. Aymen.BN allfreeads.com
    Posted November 6, 2009 at 6:29 am | Permalink

    it is really a successful business rather than making good plugins for your blog,you can be making good encomes from making plugins to people

    Cheers
    Aymen.B.R
    Allfreeads

  8. earn online degree earnonlinedegree.org
    Posted February 19, 2010 at 1:47 pm | Permalink

    i have to say this is the one of the greatest wordpress plugin

  9. LTL Trucking astnyc.com
    Posted March 16, 2010 at 11:35 pm | Permalink

    I have been designing Wordpress themes and uploading them while adding widgets but i m myself a newbie in terms of widget creation. I am looking forward for your demos about widget programming because i want to create one related to my freight website.

  10. Murtaza Khan friendslinks.co.cc
    Posted March 18, 2010 at 7:18 am | Permalink

    Very nice thanks 4 sharing

    join friends links forum

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting