Changeset 44970
- Timestamp:
- 03/21/2019 09:09:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r44842 r44970 688 688 */ 689 689 do_action( 'comment_duplicate_trigger', $commentdata ); 690 691 /** 692 * Filters duplicate comment error message. 693 * 694 * @since 5.2.0 695 * 696 * @param string $comment_duplicate_message Duplicate comment error message. 697 */ 698 $comment_duplicate_message = apply_filters( 'comment_duplicate_message', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ) ); 699 690 700 if ( true === $avoid_die ) { 691 return new WP_Error( 'comment_duplicate', __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );701 return new WP_Error( 'comment_duplicate', $comment_duplicate_message, 409 ); 692 702 } else { 693 703 if ( wp_doing_ajax() ) { 694 die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ));704 die( $comment_duplicate_message ); 695 705 } 696 706 697 wp_die( __( 'Duplicate comment detected; it looks as though you’ve already said that!' ), 409 );707 wp_die( $comment_duplicate_message, 409 ); 698 708 } 699 709 } … … 745 755 746 756 if ( $is_flood ) { 747 return new WP_Error( 'comment_flood', __( 'You are posting comments too quickly. Slow down.' ), 429 ); 757 /** This filter is documented in wp-includes/comment-template.php */ 758 $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); 759 760 return new WP_Error( 'comment_flood', $comment_flood_message, 429 ); 748 761 } 749 762 … … 889 902 */ 890 903 do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment ); 904 891 905 if ( true === $avoid_die ) { 892 906 return true; 893 907 } else { 908 /** 909 * Filters the comment flood error message. 910 * 911 * @since 5.2.0 912 * 913 * @param string $comment_flood_message Comment flood error message. 914 */ 915 $comment_flood_message = apply_filters( 'comment_flood_message', __( 'You are posting comments too quickly. Slow down.' ) ); 916 894 917 if ( wp_doing_ajax() ) { 895 die( __( 'You are posting comments too quickly. Slow down.' ));918 die( $comment_flood_message ); 896 919 } 897 920 898 wp_die( __( 'You are posting comments too quickly. Slow down.' ), 429 );921 wp_die( $comment_flood_message, 429 ); 899 922 } 900 923 }
Note: See TracChangeset
for help on using the changeset viewer.