Make WordPress Core

Ticket #37267: 37267.2.diff

File 37267.2.diff, 741 bytes (added by audrasjb, 4 years ago)

Comments: Don’t output the cancel comment link when thread_comments option is not enabled

  • src/wp-includes/comment-template.php

    diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
    index e45088729f..56d9cd0dcf 100644
    a b function comment_form( $args = array(), $post_id = null ) { 
    25302530
    25312531                comment_form_title( $args['title_reply'], $args['title_reply_to'] );
    25322532
    2533                 echo $args['cancel_reply_before'];
     2533                if ( get_option( 'thread_comments' ) ) {
     2534
     2535                        echo $args['cancel_reply_before'];
    25342536
    2535                 cancel_comment_reply_link( $args['cancel_reply_link'] );
     2537                        cancel_comment_reply_link( $args['cancel_reply_link'] );
    25362538
    2537                 echo $args['cancel_reply_after'];
     2539                        echo $args['cancel_reply_after'];
     2540
     2541                }
    25382542
    25392543                echo $args['title_reply_after'];
    25402544