The MU forums have moved to WordPress.org

Making a plugin into a widget (6 posts)

  1. carnold
    Member
    Posted 16 years ago #

    I want to widgetize a plugin. Can someone point me to docs on how to do this. I prefer not to use a plugin to widgetize, ala widgetize everything. Using 2.6.1. The plugin i want to widgetize is from xiando, friends-list. Thaks for any help.

  2. andrea_r
    Moderator
    Posted 16 years ago #

    Have a look at the google search widget that is part of the default. or it was when widgets were still a plugin. it's well-documented in the plugin itself.

  3. cafespain
    Member
    Posted 16 years ago #

    Open up the file widgets.php in the wp-includes directory.
    Scroll down to the bottom and there is a pattern for building a widget. The code doesn't have many comments in it, but you should be able to work things out.

  4. carnold
    Member
    Posted 16 years ago #

    Thanks for your replies. So i need a widgets.php file in the friends-list folder? I am not sure how this will effect it but the plugin is in the mu-plugins folder..Does that matter? Please bear with me as i ask these questions: i am unsure where in the widgets.php code i need to start. Is it the commented out section or before that?

  5. andrea_r
    Moderator
    Posted 16 years ago #

    No no no no no..... don't move that file.

    *Read* it.

  6. cafespain
    Member
    Posted 16 years ago #

    Then make a new plugin using a similar set of widget functions as in the template near the bottom, and put THAT one in your plugins folder.

About this Topic

  • Started 16 years ago by carnold
  • Latest reply from cafespain