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 |
|---|---|
| 11 | |
| 12 | $comment_post_ID = (int) $_POST['comment_post_ID']; |
| 13 | |
| 14 | $status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); |
| 15 | |
| 16 | if ( empty($status->comment_status) ) { |
| 17 | do_action('comment_id_not_found', $comment_post_ID); |
| 18 | exit; |
| 19 | } elseif ( 'closed' == $status->comment_status ) { |
| 20 | do_action('comment_closed', $comment_post_ID); |
| 21 | wp_die( __('Sorry, comments are closed for this item.') ); |
| 22 | } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { |
| 23 | do_action('comment_on_draft', $comment_post_ID); |
| 24 | exit; |
| 25 | } |
| 26 | |
| 27 | $comment_author = trim(strip_tags($_POST['author'])); |
| 28 | $comment_author_email = trim($_POST['email']); |
| 29 | $comment_author_url = trim($_POST['url']); |