I wonder if you mean this kind of check:
if( $comment->user_id > 0 ) {
// Registered comment author
}
in your comment’s template callback.
This is determined in the the wp-comments-post.php
file:
$commentdata = compact('comment_post_ID', ..., 'user_ID' );
$comment_id = wp_new_comment( $commentdata );
but it’s not obvious where the user_ID
variable comes from, since this variable is not defined in that file.
So this is actually picking up the global variable $user_ID
or $GLOBALS['user_ID']
behind our back 😉
Related Posts:
- Change Comment Author Display Name
- Comment Author Name In Reply Form
- Display all comments or recent comments per user on author page
- how to make author to write comment on only his own posts?
- How to check if commenter is the_author?
- Let user edit his own comment
- edit comments capability for authors
- Why are authors allowed to approve comments on their posts? How to revoke privilege?
- Hide notifications regarding new comments
- List user comments in author page
- Author can only see own post comment and can moderate
- WordPress comments on users profile
- Comment displaying full name even after setting another display name?
- Same email for all comments
- Notify post author for a new comment on his post?
- How many members have made comments approved for an article?
- Commentlist: bypostauthor problem with children list
- Only Allow post author and “Premium” Role user to comment
- get_comment_author_link not working properly
- Get Comment Author ID on the fly while posting
- How can I hide comment of the authors from their published posts?
- WordPress Custom Local Avatar not showing in comments
- Attaching author tag to the comment
- How to prevent users/authors from seing IP/email of new commentators?
- Author name length character limit?
- Comments counter only for Authors Posts
- Comments pagination on author page
- Change author, disable comments, enable trackbacks for all items in library
- Prevent author from editing comments from others in their post
- URLs to user page is broken
- How to ‘If Author’ Comments Check
- Auto approve all comments (editor)
- R: Comment out block of code
- How to rearrange fields in comment_form()
- Commenting in user profile page?
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- How to load and show comments with AJAX instead of pagination?
- Comments not appearing at all
- Why do I get accidental comments without (the required) email address?
- What are the current recommended best-practices for comments.php?
- How to add editor-style.css styling to wp_editor on front end for comments
- Custom Field Added In Comment Form Not Showing In Edit
- If there is a comment_author_link put url around the avatar image
- How to refresh the page when an admin trashes a comment from Comments in the admin site?
- How to add a div on comment fields / edited
- How to move comments form above comments list in wordpress
- Remove “Comment” column in all post-types
- How stop the process of submitting a comment if a field is empty?
- Can WordPress store comment cookies on two different computers?
- How to get last comments but not from admin (or other specific user role/capability)?
- Edit Comments Form in TwentyEleven
- How can I automatically delete comments that contain chinese / russian signs?
- Send Notifications to All Admins
- Disable comments
- Community Moderation Plugin for Comments [closed]
- Allow contributors to moderate comments comments on posts they write
- default callback function in wp_list_comments
- Why is comments_template() working without a comments.php file?
- Turning off trackbacks & comments
- Comment Moderation and CDN Caching
- Delete all one-word comments
- Assign author to comment from post edit page
- The “\” is missing when comments is updated
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- Why do I have to manually approve comments from one of my users who already has an approved comment?
- Get comments only for certain specific users in template file
- How to direct user after comment save
- Show comment pop up links as text only
- 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?
- Update comment meta for all comments of specific post
- How to permanently delete pages I have already trashed?
- How to change comment texts that has a specific comment_ID – Hook into comment
- counting trackbacks, pingbacks and comments of a post
- Adding comments section to website integrated WordPress instance
- How to Define Custom Number of Items in Comment Feed
- Empty comments field or
- infinite loop on page with comments after changing comments.php and header.php
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- Default Gravatar not showing for pings
- How include comment and post count of user in this custom query
- Show all people who commented on all posts by an author
- Disallow Comments
-   not working in comments
- Comments.php is not getting called on main blog page
- Allowing comments on author pages
- Comment section not appearing on posts
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Where is the Leave a Comment link set
- Disable comment moderation in multisite
- Comments Template shows, but not the comments
- Auto disable comments with custom field
- I want to fill the comment with the comment count?
- delete user not working
- How to remove or customize “Comment” in comments form?
- Getting thousands of spam comments
- check if a comment was made by a registered user
- How to disable comments on new blog post, but allow on new products?
- Show/Hide comments