[wp-hackers] Does a widget save hook exist or do I need to create a ticket in Trac?

Bjorn Wijers burobjorn at gmail.com
Thu Nov 3 14:45:35 UTC 2011


Hi,

I'm looking for a hook to use just after a widget has saved it's options.

For example:
I have a widget W whose options I have changed in the 
Appearance->Widgets screen. I press save and after the save a hook H is 
being called. My code hooks into the hook and does its thing.

Usage:
Clearing a site transient which is set in site X and also being used in 
all the other sites of my WordPress Multisite installation. Basically it 
saves me from (ab)using switch_to_blog()

I've used the 'widget_update_callback' which in fact is called before 
the update (is this a bug or feature?) as well as the 
'widget_form_callback', which gets called repeatedly something I would 
like to prevent. Any ideas for a better hook to use?

Afaik there is not (yet?) a hook directly after saving a widget's 
options. Or is there? If not shall I create a ticket for this?

Thanks in advance,

grtz
BjornW


More information about the wp-hackers mailing list