Advertisements

wp_get_current_commenter

Definition:
function wp_get_current_commenter() {}

Get current commenter’s name, email, and URL.
Expects cookies content to already be sanitized. User of this function might wish to recheck the returned array for validity.

Return values

returns:Comment author, email, url respectively.

Defined filters

  • wp_get_current_commenter
    apply_filters('wp_get_current_commenter', compact('comment_author', 'comment_author_email', 'comment_author_url')

Source code

function wp_get_current_commenter() {

	// Cookies should already be sanitized.



	$comment_author = '';

	if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) )

		$comment_author = $_COOKIE['comment_author_'.COOKIEHASH];



	$comment_author_email = '';

	if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) )

		$comment_author_email = $_COOKIE['comment_author_email_'.COOKIEHASH];



	$comment_author_url = '';

	if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) )

		$comment_author_url = $_COOKIE['comment_author_url_'.COOKIEHASH];



	return apply_filters('wp_get_current_commenter', compact('comment_author', 'comment_author_email', 'comment_author_url'));

}

3699

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: