• I need to run two instances of a wordpress widget plugin so I can use it in two different sidebars with different settings per sidebar. Essentially I need wordpress to read a recoded version of the original plugin as a whole new one. It’s critical to note that each plugin should not read off each others settings in any way and has it’s own separate administrator settings page.

    This is the plugin I’m looking at:
    http://wordpress.org/extend/plugins/visual-categories/

    I renamed the plugin folder name.
    I also renamed each php file from like “viscats.class.php” to “viscats2.class.php” and did a replace-all in all the files, changing anything that said “viscat” to “viscat2”.

    This seemed to work until I went to change settings on my new plugin. Both plugins shared the same settings.

    So my question is how to get my plugin clone to use different settings. Thanks in advance for any pointers!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Not sure this is how I’d do it but let’s start where you already are. The plugin is storing data in the DB. It doesn’t really have a choice. So, you need to find the spot where the plugin saves and retrieves its settings and change the name of the key under which it saves those settings. I’m betting you haven’t done that so both plugins are saving data to the same place in the DB and pulling data from the same place, which is why they share settings.

    Thread Starter spectromx5

    (@spectromx5)

    By all means if there was a better way to do this, show me the light!

    I did some reading about widgets and found how they store, update, and load options with built-in wordpress functions. I just had to rename a couple initial vars and everything worked like a charm :]

    For anyone interested, here’s a cloned vers of visual categories that you can use simultaneously with the original:
    http://rapidshare.com/files/294393732/viscatsCloneInst.zip.html

    Thread Starter spectromx5

    (@spectromx5)

    ^ Scratch that, the clone instance won’t output now.

    Any suggestions or better methods to run the same widget with different settings?

    Best would be to rewrite the widget to use the new Widget API, but honestly I’d have to want the widget pretty badly to rewrite someone else’s code. Second best is to hope that something like Duplicate Sidebar Widgets still works. A close third is to do what you are doing and try to work out why the second widget doesn’t work.

    It does Not work for 2.8.5.
    We need it!

    I’ve created a bunch of Widgets recently and I needed to do the same thing. I’m looking at WordPress 3 and the Text Widget does exactly this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Running Two Widget Plugin Instances’ is closed to new replies.