diff --git src/wp-includes/comment.php src/wp-includes/comment.php
index d530699..0c121b2 100644
|
|
|
function wp_handle_comment_submission( $comment_data ) { |
| 2961 | 2961 | */ |
| 2962 | 2962 | do_action( 'comment_id_not_found', $comment_post_ID ); |
| 2963 | 2963 | |
| 2964 | | return new WP_Error( 'comment_id_not_found' ); |
| | 2964 | return new WP_Error( 'comment_id_not_found', __( 'Sorry, the item you try to comment on does not exist anymore.' ), 403 ); |
| 2965 | 2965 | |
| 2966 | 2966 | } |
| 2967 | 2967 | |
| … |
… |
function wp_handle_comment_submission( $comment_data ) { |
| 2969 | 2969 | $status = get_post_status( $post ); |
| 2970 | 2970 | |
| 2971 | 2971 | if ( ( 'private' == $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) { |
| 2972 | | return new WP_Error( 'comment_id_not_found' ); |
| | 2972 | return new WP_Error( 'comment_on_private', __( 'Sorry, comments are not allowed for this item.' ), 403 ); |
| 2973 | 2973 | } |
| 2974 | 2974 | |
| 2975 | 2975 | $status_obj = get_post_status_object( $status ); |
| … |
… |
function wp_handle_comment_submission( $comment_data ) { |
| 2998 | 2998 | */ |
| 2999 | 2999 | do_action( 'comment_on_trash', $comment_post_ID ); |
| 3000 | 3000 | |
| 3001 | | return new WP_Error( 'comment_on_trash' ); |
| | 3001 | return new WP_Error( 'comment_on_trash', __( 'Sorry, comments are not allowed for this item.' ), 403 ); |
| 3002 | 3002 | |
| 3003 | 3003 | } elseif ( ! $status_obj->public && ! $status_obj->private ) { |
| 3004 | 3004 | |
| … |
… |
function wp_handle_comment_submission( $comment_data ) { |
| 3011 | 3011 | */ |
| 3012 | 3012 | do_action( 'comment_on_draft', $comment_post_ID ); |
| 3013 | 3013 | |
| 3014 | | return new WP_Error( 'comment_on_draft' ); |
| | 3014 | return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 ); |
| 3015 | 3015 | |
| 3016 | 3016 | } elseif ( post_password_required( $comment_post_ID ) ) { |
| 3017 | 3017 | |
| … |
… |
function wp_handle_comment_submission( $comment_data ) { |
| 3024 | 3024 | */ |
| 3025 | 3025 | do_action( 'comment_on_password_protected', $comment_post_ID ); |
| 3026 | 3026 | |
| 3027 | | return new WP_Error( 'comment_on_password_protected' ); |
| | 3027 | return new WP_Error( 'comment_on_password_protected', __( 'Sorry, comments are not allowed for this item.' ), 403 ); |
| 3028 | 3028 | |
| 3029 | 3029 | } else { |
| 3030 | 3030 | |