Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comment_save_pre

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
660           $ss = $_POST['ss'];
661           $jj = ($jj > 31) ? 31 : $jj;
662           $hh = ($hh > 23) ? $hh - 24 : $hh;
663           $mn = ($mn > 59) ? $mn - 60 : $mn;
664           $ss = ($ss > 59) ? $ss - 60 : $ss;
665           $datemodif = ", comment_date = '$aa-$mm-$jj $hh:$mn:$ss'";
666      } else {
667           $datemodif = '';
668      }
669      $content = apply_filters('comment_save_pre', $_POST['content']);
670
671      $result = $wpdb->query("
672           UPDATE $wpdb->comments SET
673                comment_content = '$content',
674                comment_author = '$newcomment_author',
675                comment_author_email = '$newcomment_author_email',
676                comment_approved = '$comment_status',
677                comment_author_url = '$newcomment_author_url'".$datemodif."
678           WHERE comment_ID = $comment_ID"