To fix the Recent Comments widget so that it stops messing about with trackbacks/pingbacks where they don't belong (aka in your sidebar), you'll need just a tiny change to wp-includes/widgets.php so that it becomes a bit more discerning when selecting stuff from the comments table1, quoth the .vpatch:
- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number");
+ $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' and comment_type = '' ORDER BY comment_date_gmt DESC LIMIT $number");
And to make this .vpatch worth at least two lines instead of just one, I also fixed the "default" theme so that it orders the comments at the bottom of an article: trackbacks and pingbacks should be shown there but *only* at the bottom, not messing up people's conversation. The change is made in wp-content/themes/default/comments.php as the .vpatch says:
< ol class="commentlist" >
- < ?php wp_list_comments(); ? >
+ < ?php wp_list_comments('type=comment'); ? >
+ < ?php wp_list_comments('type=pings'); ?>
< /ol >
While I looked into applying the same approach to fix the "classic" theme too, the sadness is that the classic theme takes a different approach to comments and so the required change wasn't that obvious to me right now. I'm no expert in php or mp-wp and I'm not all that keen at becoming one either so I left it for now at this and I have no claim that the solution is anything other than something that works on my blog.
The .vpatch sits on top of billymg's current v-tree head and hopefully doesn't break anything but I'm sure he'll let me know if it does2 :
line 1392 in my file ↩
According to the "no news is good news" principle, if he doesn't complain, then I'll consider it's all absolutely perfect. ↩
Comments feed: RSS 2.0
Adding for future reference & readers:
This looks good to me!
lol at the inconsistency between "" and "comment" meaning the same thing. If I had to guess I'd say the pingback type comments were added in a later version, and rather than have users migrate their existing comments to become type: 'comment' they just added the new types and decided a blank type would represent the "original" type of comment.
Thanks for the confirmation that it's all fine.
Re '' and 'comment', I think there is what you say there + the idea of "we'll make a wrapper php function to hide the pesky internals and so we get to call stuff something else (because why not)". And then of course, one gets direct select in some places and wrapper function in others.
I went to test locally and noticed the signature link in your article has some extra cruft in the path that causes it to 404. I was able to grab it from http://ossasepia.com/vpatches/mp-wp_comments_filtering.vpatch.diana_coman.sig just fine though!
Fixed it now, thanks for letting me know! (I had forgotten the http at front, so it considered it relative path and prefixed it with the site's address, hence the mess.)
[...] two weeks ago, I took one hour to produce and publish a tiny vpatch on the mp-wp V-tree, with the whole experience triggering for me a need to look at V1 again, as noted in the logs: [...]
[...] mp-wp_comments_filtering.vpatch (diana_coman) (sauce) [...]
[...] yet non-obvious changes you can make to a new installation of MP's WordPress, right up there with separating pingbacks from direct comments and chapter-and-verse [...]