| 1 |
function confirmDelete( nonceField, currentUser, customFieldID, customFieldName, returnTo, ajaxurl, what, fileName, text ) { |
| 2 |
if (confirm(text)) { |
| 3 |
jQuery.post( ajaxurl , { action:"hook_wppb_delete", currentUser:currentUser, customFieldID:customFieldID, customFieldName:customFieldName, what:what, _ajax_nonce:nonceField }, function( response ) { |
| 4 |
if( jQuery.trim(response)=="done" ){ |
| 5 |
if ( what == 'avatar' ){ |
| 6 |
alert( ep.avatar ); |
| 7 |
}else{ |
| 8 |
alert( ep.attachment +' '+ fileName ); |
| 9 |
} |
| 10 |
window.location=returnTo; |
| 11 |
}else{ |
| 12 |
alert(jQuery.trim(response)); |
| 13 |
} |
| 14 |
}); |
| 15 |
} |
| 16 |
} |