[wp-hackers] Javascript callback upon Widget save

Austin Matzko austin at ilfilosofo.com
Thu Sep 9 20:06:48 UTC 2010


On Thu, Sep 9, 2010 at 2:50 PM, John Gadbois <jgadbois at gmail.com> wrote:
> Sorry, I didn't mean a DOM event per se.  In my specific instance I have a
> color picker initializer that I call on some DOM elements.  The plugin
> probably doesn't use live(), so I'd like to reinitialize the color picker
> after the Widget gets reloaded.  It might be nice in general to have the js
> trigger custom events similar to actions on the PHP side.  Maybe it wouldn't
> be useful in many cases, I'm not sure.  In my specific case it would be.

Take a look at the wpWidgets object in wp-admin/js/widgets.dev.js.  It
has a number of public methods such as "save" that you might be able
to use by redefining them to call your functions.


More information about the wp-hackers mailing list