pre_comment_author_name
Filters the comment author's name cookie before it is set.
When this filter hook is evaluated in wp_filter_comment(), the comment author's name string is passed.
Usage
add_filter( 'pre_comment_author_name', 'wp_kama_pre_comment_author_name_filter' ); /** * Function for `pre_comment_author_name` filter-hook. * * @param string $author_cookie The comment author name cookie. * * @return string */ function wp_kama_pre_comment_author_name_filter( $author_cookie ){ // filter... return $author_cookie; }
- $author_cookie(string)
- The comment author name cookie.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
pre_comment_author_name
wp-includes/comment.php 594
$comment_author = apply_filters( 'pre_comment_author_name', $_COOKIE[ 'comment_author_' . COOKIEHASH ] );
wp-includes/comment.php 2135
$commentdata['comment_author'] = apply_filters( 'pre_comment_author_name', $commentdata['comment_author'] );
Where the hook is used in WordPress
wp-includes/default-filters.php 28
add_filter( $filter, 'sanitize_text_field' );
wp-includes/default-filters.php 29
add_filter( $filter, 'wp_filter_kses' );
wp-includes/default-filters.php 30
add_filter( $filter, '_wp_specialchars', 30 );