WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 750 | clean_comment_cache($children); |
| 751 | } |
| 752 | |
| 753 | $post_id = $comment->comment_post_ID; |
| 754 | if ( $post_id && $comment->comment_approved == 1 ) |
| 755 | wp_update_comment_count($post_id); |
| 756 | |
| 757 | clean_comment_cache($comment_id); |
| 758 | |
| 759 | do_action('wp_set_comment_status', $comment_id, 'delete'); |
| 760 | wp_transition_comment_status('delete', $comment->comment_approved, $comment); |
| 761 | return true; |
| 762 | } |
| 763 | |
| 764 | /** |
| 765 | * The status of a comment by ID. |
| 766 | * |
| 767 | * @since 1.0.0 |
| 768 | * |
| Line | Code |
| 1056 | return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error); |
| 1057 | else |
| 1058 | return false; |
| 1059 | } |
| 1060 | |
| 1061 | clean_comment_cache($comment_id); |
| 1062 | |
| 1063 | $comment = get_comment($comment_id); |
| 1064 | |
| 1065 | do_action('wp_set_comment_status', $comment_id, $comment_status); |
| 1066 | wp_transition_comment_status($comment_status, $comment->comment_approved, $comment); |
| 1067 | |
| 1068 | wp_update_comment_count($comment->comment_post_ID); |
| 1069 | |
| 1070 | return true; |
| 1071 | } |
| 1072 | |
| 1073 | /** |
| 1074 | * Updates an existing comment in the database. |