Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created September 9, 2010 20:21
Show Gist options
  • Save mjangda/572482 to your computer and use it in GitHub Desktop.
Save mjangda/572482 to your computer and use it in GitHub Desktop.
Hook into the WordPress widget save javascript callback
jQuery(document).ajaxSuccess(function(e, xhr, settings) {
var widget_id_base = 'mywidget';
if(settings.data.search('action=save-widget') != -1 && settings.data.search('id_base=' + widget_id_base) != -1) {
alert('yay!');
// do other stuff
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment