Make WordPress Core

Ticket #39650: 39650.6.patch

File 39650.6.patch, 676 bytes (added by sagarprajapati, 9 years ago)
  • wp-includes/comment.php

     
    30053005                 * @param int $comment_post_ID Post ID.
    30063006                 */
    30073007                do_action( 'comment_on_draft', $comment_post_ID );
     3008               
     3009                if ( current_user_can( 'read_post', $comment_post_ID ) ) {
     3010                        return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
     3011                } else {
     3012                        return new WP_Error( 'comment_on_draft' );
     3013                }
    30083014
    3009                 return new WP_Error( 'comment_on_draft' );
    3010 
    30113015        } elseif ( post_password_required( $comment_post_ID ) ) {
    30123016
    30133017                /**