Skip to content
1.0http://trevorcreech.com/blog/2007/03/18/wordpress-plugin-template/

Wordpress Plugin Template

Fellow Wordpress enthusiasts,
I have written several Wordpress plugins for a client over the last few weeks. Through these, I have gained some techniques for creating widgets which work as non-widgets, and also have their own options pages. With this newfound knowledge, I have created a generic plugin template. It includes all the framework necessary for a displayable plugin (Something which will show up in a sidebar, template, or anywhere in a post using a token such as <!-- someplugin -->). The template is full of comments, so you shouldn’t have trouble figuring it out. You can download it here: Wordpress Plugin Template

11 Comments

  1. Dan Cook wrote:

    does this work on pages like blogspot pages?

    Sunday, March 18, 2007 at 16:45 | Permalink
  2. Trevor wrote:

    Dan,
    This is totally different from the blogger idea of a template.

    Monday, March 19, 2007 at 15:34 | Permalink
  3. Ajay wrote:

    Trevor, you have commented out the portion declaring $pluginpath.

    Please check and confirm.

    Friday, March 23, 2007 at 3:28 | Permalink
  4. ovizii wrote:

    hello,

    I would be interested in something different, but still similar :-)
    I have several plugins that are not widgetized and as I am using wpmu not wp, meaning I don’t want to give users access to widgets that allow execution of php, I would love to find a widget template, where I could lets say insert the php code that should be executed in the sidebar (aka hardcoded) so I could make a widget for all those widgetless plugins…

    I hope you understand my explanations and if you could help that would be great, if not thx anyway :-)

    Friday, March 23, 2007 at 5:08 | Permalink
  5. Brock wrote:

    Thanks dude – I’ve been meaning to getting around to writing one for fun. This is a great starting point.

    Friday, March 23, 2007 at 9:01 | Permalink
  6. ovizii wrote:

    thx for the mail but that was not really what I was looking for :-) I’ll try again:

    in my former comment I said: `I am using wpmu not wp, meaning I don’t want to give users access to widgets that allow execution of php`

    wpmu means, anybody can sign up for a blog and get his own blog. therefore I don’t want to use widgets that allows execution of php as any user could affect my whole system by executing dangerous php. Note that on the widget that executes php it says:

    `Also note that this is isn’t exactly safe, as it’s just doing an eval() on whatever you put in there, so you have complete and full access, as does anybody else who can get to your admin screen.`

    I am looking for an easy way to widgetize a plugin, lets say a certain plugin is activated and I need to put something like in my sidebar template to get its output, I’d like to be able to input/hardcode this into a “simple” widget, rename this widget to useful_function widget and make it available to my blog users so everybody can use this plugin which originally did not provide a widget.

    I hope that was more clear this time and if you want to try this for yourself, go sign up for a testblog her: http://zice.ro but please delete it when finished with tests.

    regards
    ovidiu

    Friday, March 23, 2007 at 12:28 | Permalink
  7. Andy Beard wrote:

    This looks like fun

    Thanks for taking the time to do this, it will help me a lot

    Saturday, March 24, 2007 at 3:32 | Permalink
  8. Thanks for the translator. easy to implement and so far works like gangbusters.

    Thursday, March 29, 2007 at 15:25 | Permalink
  9. Peng Zhang wrote:

    Great Work, Trevor! This template really helps me. I have a question – does this template work with WP2.7.1?

    Wednesday, February 25, 2009 at 21:31 | Permalink
  10. paul wrote:

    hey. thanks alot for this, its proving very very helpful. there is one thing though, not sure if anyone has written this already already, but i think you need a “global $pluginpath;” in your header function. :)

    Sunday, April 19, 2009 at 12:42 | Permalink
  11. Can you provide more information on other wordpress plugins, or do you have some resources you can share with us where we can find such useful stuff? Thanks.

    Monday, February 22, 2010 at 17:02 | Permalink

8 Trackbacks/Pingbacks

  1. Skylog » Blog Archive » links for 2007-03-20 on Tuesday, March 20, 2007 at 1:21

    [...] Wordpress Plugin Template (tags: wordpress plugin) [...]

  2. [...] Wordpress Plugin Template includes all the framework necessary for a displayable plugin (Something which will show up in a sidebar, template, or anywhere in a post using a token such as ) [...]

  3. My Stuff :: Wordpress Plugin Template on Friday, March 23, 2007 at 7:28

    [...] Trev’s Travels: …a generic plugin template. It includes all the framework necessary for a displayable plugin [...]

  4. links for 2007-03-23 at L’urlo del coniglio on Friday, March 23, 2007 at 10:21

    [...] Trev’s Travels » Blog » Wordpress Plugin Template (tags: wordpress plugin) [...]

  5. Wordpress plugin template : Wordpress guy on Friday, March 23, 2007 at 16:24

    [...] hideous it’s somehow cool’ navigation on his site, Trevor Creech has built just that. A straightforward template wordpress plugin with which to build any “I have created a generic plugin template. It includes all the [...]

  6. WordPress Plugins for March 24, 2007 « designcreatology on Saturday, March 24, 2007 at 11:33

    [...] Wordpress Plugin Template includes all the framework necessary for a displayable plugin (Something which will show up in a sidebar, template, or anywhere in a post using a token such as ) [...]

  7. WP Plugins March 24, 2007 « Blogtology on Sunday, April 8, 2007 at 13:43

    [...] Wordpress Plugin Template includes all the framework necessary for a displayable plugin (Something which will show up in a sidebar, template, or anywhere in a post using a token such as ) [...]

  8. Plugin Development | Re-Cycled Air on Thursday, June 11, 2009 at 7:52

    [...] While working on the new Wrestling Addix Beta site, I was recently charged with the task to create a new wordpress plugin for the “Featured Videos” section of the site.  When I realized that I needed to do this, I was a bit overwhelmed.  I thought that making Wordpress plugins was for the real rockstar wordpress developers, but it turns out that almost anyone can do it.  I found a nice site that had a wordpress plugin template already worked out for you (complete with admin backend!), so that made it a lot easier to get things done.  If you’re interested, the site can be found here. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*