Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_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
223      $postdata = get_post($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
224
225      if ( ! $comment = get_comment($comment) )
226                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
227
228      if ( !current_user_can('edit_post', $comment->comment_post_ID) )     
229           die( __('You are not allowed to edit comments on this post.') );
230
231      wp_set_comment_status($comment->comment_ID, "delete");
232      do_action('delete_comment', $comment->comment_ID);
233
234      if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
235           header('Location: ' . $_SERVER['HTTP_REFERER']);
236      } else {
237           header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
238      }
239
240      break;
241