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.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 781 | false, |
| 782 | $commentdata['comment_author_IP'], |
| 783 | $commentdata['comment_author_email'], |
| 784 | $commentdata['comment_date_gmt'], |
| 785 | $wp_error |
| 786 | ); |
| 787 | |
| 788 | if ( $is_flood ) { |
| 789 | /** This filter is documented in wp-includes/comment-template.php */ |
| 790 | $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 791 | |
| 792 | return new WP_Error( 'comment_flood', $comment_flood_message, 429 ); |
| 793 | } |
| 794 | |
| 795 | if ( ! empty( $commentdata['user_id'] ) ) { |
| 796 | $user = get_userdata( $commentdata['user_id'] ); |
| 797 | $post_author = $wpdb->get_var( |
| 798 | $wpdb->prepare( |
| 799 | "SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", |
| Line | Code |
| 942 | return true; |
| 943 | } else { |
| 944 | /** |
| 945 | * Filters the comment flood error message. |
| 946 | * |
| 947 | * @since 5.2.0 |
| 948 | * |
| 949 | * @param string $comment_flood_message Comment flood error message. |
| 950 | */ |
| 951 | $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 952 | |
| 953 | if ( wp_doing_ajax() ) { |
| 954 | die( $comment_flood_message ); |
| 955 | } |
| 956 | |
| 957 | wp_die( $comment_flood_message, 429 ); |
| 958 | } |
| 959 | } |
| 960 | } |