Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_get_current_commenter [ WordPress Function ]

wp_get_current_commenter ( No parameters )
See:
Returns:
  • (array) Comment author, email, url respectively.
Defined at:



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.

Source


<?php
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'));
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics