This repository was archived by the owner on Apr 4, 2023. It is now read-only.
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Filter type of WebMentions to be allowed #267
Open
Description
As discussed in pfefferle/wordpress-webmention#343 and snarfed/bridgy#1347 - I only want to see replies and mentions of my blog posts, I don't want likes, retweets, boosts, reactjis etc.
This can be set in
Which is called from
Once the comment has been pre-processed, but before it is returned, the following can be added to enhance()
:
if ( isset( $commentdata['comment_meta']['semantic_linkbacks_type'] ) ) {
$comment_type = $commentdata['comment_meta']['semantic_linkbacks_type'];
if ( "mention" == $comment_type || "reply" == $comment_type ) {
// Do nothing
} else {
error_log("Deleting a " . $comment_type);
die("Comment not enhanced");
}
}
Because the function dies, the comment is never enhanced and doesn't appear in the moderation queue.
This is a quick hack. For production, it would probably need a UI to let users specify what sort of semantic linkbacks they're interested in.