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 |
|---|---|
| 799 | false, |
| 800 | $commentdata['comment_author_IP'], |
| 801 | $commentdata['comment_author_email'], |
| 802 | $commentdata['comment_date_gmt'], |
| 803 | $wp_error |
| 804 | ); |
| 805 | |
| 806 | if ( $is_flood ) { |
| 807 | /** This filter is documented in wp-includes/comment-template.php */ |
| 808 | $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 809 | |
| 810 | return new WP_Error( 'comment_flood', $comment_flood_message, 429 ); |
| 811 | } |
| 812 | |
| 813 | return wp_check_comment_data( $commentdata ); |
| 814 | } |
| 815 | |
| 816 | /** |
| 817 | * Hooks WP's native database-based comment-flood check. |
| Line | Code |
| 907 | return true; |
| 908 | } else { |
| 909 | /** |
| 910 | * Filters the comment flood error message. |
| 911 | * |
| 912 | * @since 5.2.0 |
| 913 | * |
| 914 | * @param string $comment_flood_message Comment flood error message. |
| 915 | */ |
| 916 | $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 917 | |
| 918 | if ( wp_doing_ajax() ) { |
| 919 | die( $comment_flood_message ); |
| 920 | } |
| 921 | |
| 922 | wp_die( $comment_flood_message, 429 ); |
| 923 | } |
| 924 | } |
| 925 | } |