Support » Plugin: Never Moderate Registered Users » Allow registered to comment but moderate if url posted?

Viewing 1 replies (of 1 total)
  • Plugin Author Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    @jeriksson: Hi, it’s been awhile since your request but I thought I’d let you (and anyone else who happens upon this thread) know that the just-released v2.2 of Never Moderate Registered Users facilitates your request.

    The following code (if put into your active theme’s functions.php file, or ideally in a site-specific plugin) will allow the plugin to permit registered users to comment without being moderated unless they post a full URL.


    /**
    * Always moderate comments by registered users if they mention "Google".
    *
    * @param bool $approved Approval status. Accepts 1, 0, 'spam', WP_Error.
    * @param array $commentdata Comment data.
    * @param WP_User $user The commenting user.
    * @return bool
    */
    function c2c_moderate_registered_user_comments_with_url( $approved, $commentdata, $user ) {
    if ( $approved && ( false !== stripos( $commentdata['comment_content'], 'http://' ) || false !== stripos( $commentdata['comment_content'], 'https://' ) ) ) {
    $approved = 0;
    }
    return $approved;
    }
    add_filter( 'c2c_moderate_registered_user_comments_with_url', 10, 3 );

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.