Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_comment_author_email

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
634            * Filters the comment author's email cookie before it is set.
635            *
636            * When this filter hook is evaluated in wp_filter_comment(),
637            * the comment author's email string is passed.
638            *
639            * @since 1.5.0
640            *
641            * @param string $author_email_cookie The comment author email cookie.
642            */
643           $comment_author_email = apply_filters( 'pre_comment_author_email', $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] );
644           $comment_author_email = wp_unslash( $comment_author_email );
645           $comment_author_email = esc_attr( $comment_author_email );
646
647           $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] = $comment_author_email;
648      }
649
650      if ( isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {
651           /**
652            * Filters the comment author's URL cookie before it is set.
 
Line Code
2178       *
2179       * @since 1.5.0
2180       *
2181       * @param string $comment_author_ip The comment author's IP address.
2182       */
2183      $commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );
2184      /** This filter is documented in wp-includes/comment.php */
2185      $commentdata['comment_author_url'] = apply_filters( 'pre_comment_author_url', $commentdata['comment_author_url'] );
2186      /** This filter is documented in wp-includes/comment.php */
2187      $commentdata['comment_author_email'] = apply_filters( 'pre_comment_author_email', $commentdata['comment_author_email'] );
2188
2189      $commentdata['filtered'] = true;
2190
2191      return $commentdata;
2192 }
2193
2194 /**
2195  * Determines whether a comment should be blocked because of comment flood.
2196  *