if (!current_user_can('edit_comment', $comment->comment_ID)) { die('-1'); } check_ajax_referer("delete-comment_{$id}"); $status = nxt_get_comment_status($comment->comment_ID); $delta = -1; if (isset($_POST['trash']) && 1 == $_POST['trash']) { if ('trash' == $status) { die((string) time()); } $r = nxt_trash_comment($comment->comment_ID); } elseif (isset($_POST['untrash']) && 1 == $_POST['untrash']) { if ('trash' != $status) { die((string) time()); } $r = nxt_untrash_comment($comment->comment_ID); if (!isset($_POST['comment_status']) || $_POST['comment_status'] != 'trash') { // undo trash, not in trash $delta = 1; } } elseif (isset($_POST['spam']) && 1 == $_POST['spam']) { if ('spam' == $status) { die((string) time()); } $r = nxt_spam_comment($comment->comment_ID); } elseif (isset($_POST['unspam']) && 1 == $_POST['unspam']) { if ('spam' != $status) { die((string) time()); } $r = nxt_unspam_comment($comment->comment_ID); if (!isset($_POST['comment_status']) || $_POST['comment_status'] != 'spam') {
$unapproved++; break; case 'spam': nxt_spam_comment($comment_id); $spammed++; break; case 'unspam': nxt_unspam_comment($comment_id); $unspammed++; break; case 'trash': nxt_trash_comment($comment_id); $trashed++; break; case 'untrash': nxt_untrash_comment($comment_id); $untrashed++; break; case 'delete': nxt_delete_comment($comment_id); $deleted++; break; } } if ($approved) { $redirect_to = add_query_arg('approved', $approved, $redirect_to); } if ($unapproved) { $redirect_to = add_query_arg('unapproved', $unapproved, $redirect_to); } if ($spammed) {