Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_set_comment_status

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
282      if ( ! $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1") )
283           return false;
284
285      $post_id = $comment->comment_post_ID;
286      if ( $post_id && $comment->comment_approved == 1 )
287           wp_update_comment_count($post_id);
288
289      clean_comment_cache($comment_id);
290
291      do_action('wp_set_comment_status', $comment_id, 'delete');
292      return true;
293 }
294
295
296 function wp_get_comment_status($comment_id) {
297      global $wpdb;
298
299      $comment = get_comment($comment_id);
300      if ( !$comment )
 
Line Code
441           default:
442                return false;
443      }
444
445      if ( !$wpdb->query($query) )
446           return false;
447
448      clean_comment_cache($comment_id);
449
450      do_action('wp_set_comment_status', $comment_id, $comment_status);
451      $comment = get_comment($comment_id);
452      wp_update_comment_count($comment->comment_post_ID);
453
454      return true;
455 }
456
457
458 function wp_update_comment($commentarr) {
459      global $wpdb;