hack widget to reuse again (6 posts)

  1. deyelicious
    Posted 2 years ago #

    some widget that i found, just can't be reused,,
    i just can use it once,,
    how to hack widget so i can reuse again?

  2. Tara
    Volunteer Moderator
    Posted 2 years ago #

    which plugn? did you find that plugin here (http://wordpress.org/extend/plugins/)? Or, somewhere else? you may want to contact the plugin author.

  3. bcworkz
    Posted 2 years ago #

    I've noticed in the options table under various widget names, there's an array key/value pair '_multiwidget' => 1 for most widgets. I'm guessing widgets without this cannot be reused.

    I don't know if this is the answer, just something I noticed.

  4. deyelicious
    Posted 2 years ago #

    @t-p : yes, i got it from http://wordpress.org/extend/plugins/
    @bcworkz : honestly, i got an answer that i can use widget API, but i confused how to use it :(

  5. bcworkz
    Posted 2 years ago #

    I looked into this a bit. The original way of creating widgets created single-use ones, and one needed to do some special things to make it reusable. With the introduction of the Widget API, widgets so created were automatically multi-use. So it may just be a matter of changing how the widget is created.

    Most interesting is a function exists to convert old single use widgets to multi-use: Function Reference/wp convert widget settings. Unfortunately, I've no idea how to use it. Fortunately, there is a widget object method 'get_settings' that does the conversion as part of the method. You just need to find the variable to which the widget object was assigned when it was instantiated.

    If that sounds like a foreign language, maybe the best approach is as t-p suggests - contact the author.

  6. deyelicious
    Posted 2 years ago #

    @bcworkz : yeah, that's the problem, i got the answer but i don't how to use it,,but i'll try to contact the author..well, tq so much, i appreciate for what are you looking for me,, :)

Topic Closed

This topic has been closed to new replies.

About this Topic