Open edent opened 1 year ago
The comment gets saved at:
So I need a way to (manually) see if $commentdata
is a reply, repost, like etc.
I assume that'll be $commentdata['comment_meta']['semantic_linkbacks_type']
?
In V5, the saving of the WebMention happens in:
So the logic to delete certain types of WebMention could happen there. Although it might be easier / more efficient to do it at the top of the function:
There are now specific comment types - so should be easier to filter.
Is there a way to use the 5.1.2 filtering to remove these messages? I've just received 200 "Bridgy Response" mentions which I need to delete.
I've added this to my theme's functions.php
file:
// Remove Bridgy likes and reposts
add_action( 'comment_post', 'check_comment_content', 10, 2 );
function check_comment_content( $comment_id, $comment_approved ) {
$comment = get_comment( $comment_id );
// Check if the comment is a like or repost
if ( $comment->comment_type == "like" || $comment->comment_type == "repost" ) {
// Set the comment status to 'trash'
wp_delete_comment( $comment_id );
}
}
As discussed in https://github.com/snarfed/bridgy/issues/1347
Yesterday I posted a link to my blog on Mastodon. This morning I work up to:![139 comments](https://user-images.githubusercontent.com/837136/201832864-5d715dc5-5c4f-4ff0-a71f-a0155d99d55a.png)
Nearly all of them were likes and reposts:![Screenshot of lots of comments](https://user-images.githubusercontent.com/837136/201833013-e45f1843-b7a5-4186-b9d9-4b65466c758f.png)
What would I need to do to change the plugin so it ignored reposts & likes?
Thanks!