New BuddyPress plugin: Remove Previous Comment Edits From BuddyPress Activity

UPDATE: BP Dev Andy writes in a comment to this post that this bug will be fixed in BP core soon. If you’re running a recent version of BP, it’s likely that you won’t need this plugin. Please make sure you can reproduce the issue before installing.

This plugin fixes a small but potentially annoying quirk in BuddyPress. If you, as a blog owner, edit a comment that appears on your blog, BuddyPress adds an entry to the sitewide and individual activity streams – but it doesn’t delete the old entries. As a result, if you end up (for example) editing your own comment a few times in a row, you’ll see multiple items on the activity feed.

This plugin fixes the problem by checking whether a submitted comment is an edit, and if it is, by deleting previous versions of the comment in the activity stream.

Until the plugin is in the WordPress repository, I’ve made it available in a zip file here. Just load bp-activity-skip-comment-edits.php into your /wp-content/plugins folder, activate in Dashboard > Plugins (sitewide, if you’d like), and you should be good to go.

3 thoughts on “New BuddyPress plugin: Remove Previous Comment Edits From BuddyPress Activity”

  1. This is going to break for 1.1, but I’ll fix this up in the core. I’d be happy to fix this in BuddyPress quickly for you if you provide the changes needed, rather than spending time hacking around the bug with a plugin.

  2. Hi Andy – thanks for stopping by. I wrote this admittedly very ugly hack instead of reporting as a bug because this was one of those cases where I wasn’t sure whether the behavior was a feature or a bug! After all, you’re not often in a position where you need to edit the content of comments on your blog, and when you do, sometimes you might actually *want* them to appear on the activity screen. Anyway, thanks for looking at it – once it’s fixed in the trunk I will put a note on this page saying that the plugin’s not needed.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image