Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comment_text

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
39  * @return bool Whether the checks passed (true) and the comments should be
40  *          displayed or set to moderated
41  */
42 function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) {
43      global $wpdb;
44
45      if ( 1 == get_option('comment_moderation') )
46           return false; // If moderation is set to manual
47
48      if ( get_option('comment_max_links') && preg_match_all("/<[Aa][^>]*[Hh][Rr][Ee][Ff]=['\"]([^\"'>]+)[^>]*>/", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') )
49           return false; // Check # of external links
50
51      $mod_keys = trim(get_option('moderation_keys'));
52      if ( !empty($mod_keys) ) {
53           $words = explode("\n", $mod_keys );
54
55           foreach ( (array) $words as $word) {
56                $word = trim($word);
57