Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: trashed_post_comments

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
1358      foreach ( $comments as $comment )
1359           $statuses[$comment->comment_ID] = $comment->comment_approved;
1360      add_post_meta($post_id, '_wp_trash_meta_comments_status', $statuses);
1361
1362      // Set status for all comments to post-trashed
1363      $result = $wpdb->update($wpdb->comments, array('comment_approved' => 'post-trashed'), array('comment_post_ID' => $post_id));
1364
1365      clean_comment_cache( array_keys($statuses) );
1366
1367      do_action('trashed_post_comments', $post_id, $statuses);
1368
1369      return $result;
1370 }
1371
1372 /**
1373  * Restore comments for a post from the trash
1374  *
1375  * @since 2.9.0
1376  * @uses do_action() on 'untrash_post_comments' before trashing