Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comment_flood_message

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
761           false,
762           $commentdata['comment_author_IP'],
763           $commentdata['comment_author_email'],
764           $commentdata['comment_date_gmt'],
765           $avoid_die
766      );
767
768      if ( $is_flood ) {
769           /** This filter is documented in wp-includes/comment-template.php */
770           $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );
771
772           return new WP_Error( 'comment_flood', $comment_flood_message, 429 );
773      }
774
775      if ( ! empty( $commentdata['user_id'] ) ) {
776           $user        = get_userdata( $commentdata['user_id'] );
777           $post_author = $wpdb->get_var(
778                $wpdb->prepare(
779                     "SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1",
 
Line Code
918                     return true;
919                } else {
920                     /**
921                      * Filters the comment flood error message.
922                      *
923                      * @since 5.2.0
924                      *
925                      * @param string $comment_flood_message Comment flood error message.
926                      */
927                     $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) );
928
929                     if ( wp_doing_ajax() ) {
930                          die( $comment_flood_message );
931                     }
932
933                     wp_die( $comment_flood_message, 429 );
934                }
935           }
936      }