WordPress.org

Ready to get started?Download WordPress

Forums

hack widget to reuse again (6 posts)

  1. deyelicious
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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

Tags