2

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?

1 Answer 1

2

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;
}
2
  • Sorry for delay in answer, I'll take a look at this solution later this week, and if it works will accept answer. Looks roughly like it should work. A simple and elegant solution if it does!
    – ToniWidmo
    Apr 3, 2012 at 9:56
  • Well I've implemented this and seen existing a new members post without needing moderation and comments from non-users still need moderating so this definitely works.
    – ToniWidmo
    Apr 10, 2012 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.