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 |
---|---|
2 | require( dirname(__FILE__) . '/wp-config.php' ); |
3 |
|
4 | nocache_headers(); |
5 |
|
6 | $comment_post_ID = (int) $_POST['comment_post_ID']; |
7 |
|
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 |
|