Make WordPress Core

Ticket #39650: 39650.2.patch

File 39650.2.patch, 596 bytes (added by sagarprajapati, 9 years ago)

Followed the standards

  • wp-includes/comment-template.php

     
    21652165 * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post.
    21662166 */
    21672167function comment_form( $args = array(), $post_id = null ) {
     2168        //Don't show comment form if post status is not publish.
     2169        if ( 'draft' === get_post_status( $post ) ) {
     2170                return;
     2171        }
     2172       
    21682173        if ( null === $post_id )
    21692174                $post_id = get_the_ID();
    21702175