Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: preprocess_comment

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

Line Code
25      if ( file_exists( $include ) )
26           require( $include );
27      else
28           require( ABSPATH . 'wp-content/themes/default/comments.php');
29
30      endif;
31 }
32
33 function wp_new_comment( $commentdata ) {
34      $commentdata = apply_filters('preprocess_comment', $commentdata);
35
36      $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
37      $commentdata['user_ID']         = (int) $commentdata['user_ID'];
38
39      $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];
40      $commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
41
42      $commentdata['comment_date']     = current_time('mysql');
43      $commentdata['comment_date_gmt'] = current_time('mysql', 1);