Switch language

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




wp_set_comment_cookies [ WordPress Function ]

wp_set_comment_cookies ( $comment, $user )
Parameters:
  • (object) $comment Comment object.
  • (object) $user Comment author's object.
Defined at:



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.

Source


<?php
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_authortime() + $comment_cookie_lifetimeCOOKIEPATHCOOKIE_DOMAIN);
    
setcookie('comment_author_email_' COOKIEHASH$comment->comment_author_emailtime() + $comment_cookie_lifetimeCOOKIEPATHCOOKIE_DOMAIN);
    
setcookie('comment_author_url_' COOKIEHASHesc_url($comment->comment_author_url), time() + $comment_cookie_lifetimeCOOKIEPATHCOOKIE_DOMAIN);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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