Open edent opened 2 years 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:
Nearly all of them were likes and reposts:
What would I need to do to change the plugin so it ignored reposts & likes?
Thanks!