As of v2.0.0 of ActivityPub for WordPress, you …

As of v2.0.0 of ActivityPub for WordPress, you can add this here code snippet to your WordPress site to stop it from silently accepting comment updates:

add_action( 'activitypub_handled_update', function( $activity, $second_param, $state, $reaction ) {
	if ( $reaction instanceof \WP_Comment ) {
		wp_set_comment_status( $reaction, 'hold' );
	}
}, 99, 4 );

That is, it won’t stop the comment from being updated, but it’ll require reapproval before it gets shown on your blog.

(I still don’t know what the second argument does exactly.) 🤣

Likes, Bookmarks, and Reposts

  • Patrick

3 responses to “As of v2.0.0 of ActivityPub for WordPress, you …”

  1. Terence Eden Avatar

    @jan @janboddez
    Do you know any way to stop it posting comments which are replies to non-fediverse comments?

    My feed is filling up with out of context replies 😅

  2. Terence Eden Avatar

    Works perfectly! Thanks 🙂

  3. Jan Boddez Avatar

    @jan Going to add a `wp_mail()` or so statement, because if a bunch of edits happen in the background, they tend to get lost among the pending comments.

    Or a simple `wp_notify_moderator( $reaction->comment_ID );`

Leave a Reply

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