Paged Comment Editing patch for comment counter

It seems that my last problem with WordPress comment counter were not totally fixed. Mike Little has submitted a patch for WordPress core file which suppose to solve my problem. But under some circumstances, the patch didn’t work.

So today I decided to dig around the submitted patch for issue #2159 then I realized something about Paged Comment Editing that overrides WordPress default ‘Manage’ -> ‘Comments’ view with a paged view and optionally displays spam comments which I use for my comments management. Well, indeed that Page Comment Editing plugin is the culprit.

Take note. This fix and patch only applied if you are using Paged Comment Editing plugin by Coldforged and WordPress 2.0.

How to fix comment counter with Paged Comment Editing plugin enabled.

  1. Open edit-comments-full.php.
  2. Somewhere in line 175.

    Find $wpdb->query("DELETE FROM $tablecomments WHERE comment_ID = $comment");

    And then replace with wp_set_comment_status($comment, "delete");

  3. Save and close edit-comments-full.php.
  4. To make the comment counter or numbering correct again, you have to submit a dummy comment to that entry and then delete it.

I’ve made a paged-comment-editing.patch file for your convenience.

Now we have to wait for the plugin to be officially updated by the author.