Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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