diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index d245026d66..77c5b4e6d7 100644
a
|
b
|
function wp_allow_comment( $commentdata, $avoid_die = false ) { |
744 | 744 | ); |
745 | 745 | |
746 | 746 | if ( $is_flood ) { |
747 | | return new WP_Error( 'comment_flood', __( 'You are posting comments too quickly. Slow down.' ), 429 ); |
| 747 | /** |
| 748 | * Filters the comment flood message. |
| 749 | * |
| 750 | * @since 5.2.0 |
| 751 | * |
| 752 | * @param string $comment_flood_message_filter Comment flood notification text. |
| 753 | */ |
| 754 | $comment_flood_message_filter = apply_filters( 'comment_flood_message_filter', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 755 | |
| 756 | return new WP_Error( 'comment_flood', $comment_flood_message_filter, 429 ); |
748 | 757 | } |
749 | 758 | |
750 | 759 | if ( ! empty( $commentdata['user_id'] ) ) { |
… |
… |
function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = fal |
891 | 900 | if ( true === $avoid_die ) { |
892 | 901 | return true; |
893 | 902 | } else { |
| 903 | /** |
| 904 | * Filters the comment flood message. |
| 905 | * |
| 906 | * @since 5.2.0 |
| 907 | * |
| 908 | * @param string $comment_flood_message_filter Comment flood notification text. |
| 909 | */ |
| 910 | $comment_flood_message_filter = apply_filters( 'comment_flood_message_filter', __( 'You are posting comments too quickly. Slow down.' ) ); |
| 911 | |
894 | 912 | if ( wp_doing_ajax() ) { |
895 | | die( __( 'You are posting comments too quickly. Slow down.' ) ); |
| 913 | die( $comment_flood_message_filter ); |
896 | 914 | } |
897 | 915 | |
898 | | wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 ); |
| 916 | wp_die( $comment_flood_message_filter, 429 ); |
899 | 917 | } |
900 | 918 | } |
901 | 919 | } |