Skip to:
Content
Pages
Categories
Search
Top
Bottom

Comment Author Not Recorded in Activity Stream

  • @jemar707

    Participant

    I am reverted for testing to Twenty-fourteen Theme, using 4.1. I am using BuddyPress 2.1.1 and settings to allow activity stream commenting on blog and forum posts and our discussion settings in WordPress are that users do not need to login to comment, we also do not require an email to comment. Blog post comments appear in the activity stream; however, for comments by non-members there is no name. I presume this is expected behavior since the comment author does not have an email address and there user_id is 0. I found a few threads that pointed to a solution for similar behavior, but these regarded whether or not the blog was set to public. Ours is set to public, so I don’t think this is the case.

    Is there a way to use get_comment_author from WP if the email address is blank? After much reading and reading on this, but having little experience with PHP, I traced this as expected behavior possibly to bp-blogs-functions.php, starting around line 556 I believe:

    // Get the user by the comment author email.
    $user = get_user_by( ’email’, $recorded_comment->comment_author_email );

    // If user isn’t registered, don’t record activity
    if ( empty( $user ) )
    return false;

    Is there a way I could achieve something like this instead?

    // Get the user by the comment author email.
    $author = get_comment_author( $comment_id );
    $user = get_user_by( ’email’, $recorded_comment->comment_author_email );

    // If user isn’t registered, don’t record activity
    if ( empty( $user ) )
    return $author;

    Or anything else suggested?

Viewing 1 replies (of 1 total)
  • @jemar707

    Participant

    anyone? I’ve exhausted everything and can’t seem to find any solutions. I try to read everything in forums and online that I can before posting a question.

Viewing 1 replies (of 1 total)
  • The topic ‘Comment Author Not Recorded in Activity Stream’ is closed to new replies.
Skip to toolbar