An unregistered user’s name and email are available in cookies, once s/he has left a comment. The cookies are named like:
comment_author_3e6aea64ec43ed661a5dee3433f1e8bc
comment_author_email_3e6aea64ec43ed661a5dee3433f1e8bc
You can retrieve them like so:
sanitize_comment_cookies();
wp_get_current_commenter(); // returns comment_author,
// comment_author_email, comment_author_url
They’re created here in comment.php
:
/**
* Sets the cookies used to store an unauthenticated commentator's identity. Typically used
* to recall previous comments by this commentator that are still held in moderation.
*
* @param object $comment Comment object.
* @param object $user Comment author's object.
*
* @since 3.4.0
*/
function wp_set_comment_cookies($comment, $user) {
if ( $user->exists() )
return;
$comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, ...);
setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, ...);
setcookie('comment_author_url_' . COOKIEHASH, ...);
}
(I found out by stepping through wp-comments-post.php
with a debugger.)
((As mentioned in the comments below the original question above, couldn’t this sometimes be a privacy issue, if someone posts a comment in a public library — then the one who uses the computer afterwards might find those comments that are “waiting for authentication”, and know who wrote them, hmm))