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 |
---|---|
8 | $status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); |
9 |
|
10 | if ( empty($status->comment_status) ) { |
11 | do_action('comment_id_not_found', $comment_post_ID); |
12 | exit; |
13 | } elseif ( 'closed' == $status->comment_status ) { |
14 | do_action('comment_closed', $comment_post_ID); |
15 | die( __('Sorry, comments are closed for this item.') ); |
16 | } elseif ( 'draft' == $status->post_status ) { |
17 | do_action('comment_on_draft', $comment_post_ID); |
18 | exit; |
19 | } |
20 |
|
21 | $comment_author = trim($_POST['author']); |
22 | $comment_author_email = trim($_POST['email']); |
23 | $comment_author_url = trim($_POST['url']); |
24 | $comment_content = trim($_POST['comment']); |
25 |
|
26 | // If the user is logged in |