X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..caeaf8dc94b5e3f75dc98ec92dc7b76049cdddb6:/wp-admin/js/user-profile.js diff --git a/wp-admin/js/user-profile.js b/wp-admin/js/user-profile.js index b107d987..ae4b97ab 100644 --- a/wp-admin/js/user-profile.js +++ b/wp-admin/js/user-profile.js @@ -124,4 +124,22 @@ }); }); + $( '#destroy-sessions' ).on( 'click', function( e ) { + var $this = $(this); + + wp.ajax.post( 'destroy-sessions', { + nonce: $( '#_wpnonce' ).val(), + user_id: $( '#user_id' ).val() + }).done( function( response ) { + $this.prop( 'disabled', true ); + $this.siblings( '.notice' ).remove(); + $this.before( '

' + response.message + '

' ); + }).fail( function( response ) { + $this.siblings( '.notice' ).remove(); + $this.before( '

' + response.message + '

' ); + }); + + e.preventDefault(); + }); + })(jQuery);