Allowing logged in users to comment without moderation across a multisite installation

I currently do web admin for an internet community based on BuddyPress and Multi Site, and use the Comment author must have a previously approved comment setting to make it easier for users to comment and not be moderated. All users are vetted before their accounts are created so I know we don't have spambots.

However it does not quite behave as I wish it to and I wonder if there is a way to achieve what I want. Ideally what I'd like is for:

  1. All logged in users to be able to comment anywhere on the multi-site without moderation that they have right to comment on, unless the owner of the subsite has ticked 'An administrator must always approve the comment'
  2. For non-logged in comments to always be approved if they've ever been approved anywhere on the multi-site. (Currently it only works if the new comment is on a post by the same author on the same site they were previously approved on)

Is this possible using existing settings or plugins? If not can it be achieved another way and if so how?

Topic multisite comments users moderation Wordpress

Category Web


You could hook into 'pre_comment_approved' and change its return value. Sample code, not tested:

add_filter( 'pre_comment_approved', 'wpse47172_approve_logged_in_users' );

function wpse47172_approve_logged_in_users( $approved )
{
    return is_user_logged_in() ? 1 : $approved;
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.