You can simplly check
if ($comment->user_id > 0){
//comment by registered user
}else{
//comment by none registered user
}
Related Posts:
- Commenting in user profile page?
- What should I do to make generated avatars different for anonymous comments?
- Show content only if member left a comment
- How to display random users with avatars
- Post comment as different user than logged in
- Wrong gravatar showing up?
- Get most active users sort by comment count
- WordPress comments email notification for authors
- remove_filter( ‘comment_author’, ‘floated_admin_avatar’ ); doesn’t work
- Replace comment avatars and links at the same time
- List User Comments on User Profile BuddyPress [closed]
- Hold comments for moderation only if user is not logged in
- Display WordPress commenter nice name
- Cannot get local avatars to show [closed]
- Check if someone recently commented in one of my posts
- Highlighting the current users comment
- Display the number of unseen comments on a page since the user last visit
- How to display html in only the first level of WP comments?
- How to change avatar of the comment author using comment ID?
- woocommerce allow users to select or use avatar
- Comment Form – E-mail Not Required!
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Allow the comment author to delete their own comments
- All users/comments suspected as bot? [closed]
- Commenting in user profile page?
- if user role is then echo text
- Remove the deleted user comment
- Anonymize comments after one year
- How can I get list of emails of users who commented on a post?
- Why could my comment_form variable not be working?
- Custom comment field not showing when logged-in
- get_comment_author_link not working properly
- Problem in getting user comments permalinks
- Upload avatar for post comment
- WordPress Custom Local Avatar not showing in comments
- wp list all users who haven’t commented on a post
- I want to limit registered user to 1 comment per post in WordPress
- Let user delete comment on front end only
- WordPress shows admin’s avatar after editing a comment
- selectively disable akismet
- How to display comments by logged in user and responses?
- Deleting users do not deletes coments
- delete user not working
- If paginated comments don’t span to a second page, how do I hide the div wrapper?
- How can I filter the user avatar displayed in comments? – get_avatar_url filter works everywhere but not in comments
- Reverse comment pagination numbers
- get recent comments of a particular category
- WP_Comment_Query() displays “password protected” comments?
- Is it possible to move a comment that should be a reply to another comment?
- Can I seperate comments from post?
- Making a Comment on a page without being on that page?
- Display commenter’s registration date on comments?
- How do I display the commentor’s first name and last name in the comments?
- What is the server IP comment hack
- How to add consent checkbox in comment section
- Do I have to have a nonce for a custom comment field?
- Get last seen date/time in wordpress get_comments() [closed]
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- How to get replies of a comment?
- Share comment to twitter after publishing [closed]
- changing comment-page-# to something like review-page-#
- Add filter to comments loop?
- Show comments to unregistered users
- User capability for editing their own comments
- Adding character count and limit in comments, modifying labels and fields – jetpack
- Check if comment was successfully submited
- Change id=”respond” to the comments container
- Comments on Author page
- Getting comment count per post not working
- Using a static callback on wp_insert_comment
- How to prevent multiple comments
- Displaying comments on pages distinguished by GET IDs
- Is there a hook to update / replace values in the “Enable threaded (nested) comments x levels deep” drop down?
- Filter to wp_list_authors
- Can’t reply to comments [closed]
- How do I pull avatar from post using BuddyPress? [closed]
- counting trackbacks, pingbacks and comments of a post
- Get users with different roles and call function on each of them (user_meta)
- ask and edit an extra comment field
- Show errormessages on wrong username/password on custom loginform?
- Modify links in user comments
- How indicate when a functions was upgraded in relationship to the entire program [closed]
- How to filter comments by comment_meta
- Prevent users to delete comments from trash
- How do I change where “You must be logged in to comment” directs users?
- How can I hide comment of the authors from their published posts?
- How to customize ‘children comments’ in WordPress?
- How to display replies to his comments in user profile of current user
- Top rated posts Average rating issue
- stop url changing when user comments
- Keep comment author’s name on their comment even when their account is deleted
- WordPress Commenting System User access and Security
- Comments.php is not getting called on main blog page
- Allowing comments on author pages
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- I want to fill the comment with the comment count?
- Replace do_action() with a normal submit form in comments.php
- Comments on pages not appearing, even though I enabled them
- Customize the new comment notifications sent to the post author after the comment is approved
- Get approved comments or comments that the author is me