diff --git a/wp-includes/comment.php b/wp-includes/comment.php index ba60070fd7..7398f99dd9 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -3005,8 +3005,12 @@ function wp_handle_comment_submission( $comment_data ) { * @param int $comment_post_ID Post ID. */ do_action( 'comment_on_draft', $comment_post_ID ); - - return new WP_Error( 'comment_on_draft' ); + + if ( current_user_can( 'read_post', $comment_post_ID ) ) { + return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 ); + } else { + return new WP_Error( 'comment_on_draft' ); + } } elseif ( post_password_required( $comment_post_ID ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 5c3a0a55ea..ea1b8ffc52 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40127'; +$wp_version = '4.8-alpha-40128'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.