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 |
|---|---|
| 3 | |
| 4 | $comment_post_ID = (int) $_POST['comment_post_ID']; |
| 5 | |
| 6 | $status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); |
| 7 | |
| 8 | if ( empty($status->comment_status) ) { |
| 9 | do_action('comment_id_not_found', $comment_post_ID); |
| 10 | exit; |
| 11 | } elseif ( 'closed' == $status->comment_status ) { |
| 12 | do_action('comment_closed', $comment_post_ID); |
| 13 | die( __('Sorry, comments are closed for this item.') ); |
| 14 | } elseif ( 'draft' == $status->post_status ) { |
| 15 | do_action('comment_on_draft', $comment_post_ID); |
| 16 | exit; |
| 17 | } |
| 18 | |
| 19 | $comment_author = trim($_POST['author']); |
| 20 | $comment_author_email = trim($_POST['email']); |
| 21 | $comment_author_url = trim($_POST['url']); |