| 1 | Index: wp-comments-post.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-comments-post.php (revision 2837) |
|---|
| 4 | +++ wp-comments-post.php (working copy) |
|---|
| 5 | @@ -37,9 +37,14 @@ |
|---|
| 6 | +add_action('comment_problem','wp_comment_error_message'); |
|---|
| 7 | +function wp_comment_error_message($comment_msg) { |
|---|
| 8 | + die($comment_msg); |
|---|
| 9 | +} |
|---|
| 10 | + |
|---|
| 11 | if ( get_settings('require_name_email') && !$user_ID ) { |
|---|
| 12 | if ( 6 > strlen($comment_author_email) || '' == $comment_author ) |
|---|
| 13 | - die( __('Error: please fill the required fields (name, email).') ); |
|---|
| 14 | + do_action( 'comment_problem', __('Error: please fill the required fields (name, email).') ); |
|---|
| 15 | elseif ( !is_email($comment_author_email)) |
|---|
| 16 | - die( __('Error: please enter a valid email address.') ); |
|---|
| 17 | + do_action( 'comment_problem', __('Error: please enter a valid email address.') ); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | if ( '' == $comment_content ) |
|---|
| 21 | - die( __('Error: please type a comment.') ); |
|---|
| 22 | + do_action('comment_problem', __('Error: please type a comment.') ); |
|---|