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.
Line | Code |
---|---|
2483 | foreach ( $comments as $comment ) |
2484 | $statuses[$comment->comment_ID] = $comment->comment_approved; |
2485 | add_post_meta($post_id, '_wp_trash_meta_comments_status', $statuses); |
2486 |
|
2487 | // Set status for all comments to post-trashed |
2488 | $result = $wpdb->update($wpdb->comments, array('comment_approved' => 'post-trashed'), array('comment_post_ID' => $post_id)); |
2489 |
|
2490 | clean_comment_cache( array_keys($statuses) ); |
2491 |
|
2492 | do_action('trashed_post_comments', $post_id, $statuses); |
2493 |
|
2494 | return $result; |
2495 | } |
2496 |
|
2497 | /** |
2498 | * Restore comments for a post from the trash |
2499 | * |
2500 | * @since 2.9.0 |
2501 | * @uses do_action() on 'untrash_post_comments' before trashing |