public static function maybe_change_comment_status($commentID, $postID) { global $aecomments; if (isset($_POST['comment_status'])) { $oldComment = get_comment($commentID, ARRAY_A); //Used in the undo portion $aecomments->save_admin_option('undo', $oldComment); switch ($_POST['comment_status']) { case "1": if ($_POST['comment_status'] != $oldComment['comment_approved']) { AECAjax::approve_comment($commentID, $postID); } break; case "0": AECAjax::moderate_comment($commentID, $postID); break; case "spam": AECAjax::spam_comment($commentID, $postID); break; case "trash": if ($_POST['comment_status'] != $oldComment['comment_approved']) { AECAjax::delete_comment($commentID, $postID); } break; } } }