Make WordPress Core


Ignore:
Timestamp:
11/16/2021 02:13:25 AM (3 years ago)
Author:
hellofromTonya
Message:

Comments: Don't output "cancel comment reply link" if comments aren't threaded.

Though hidden via style="display:none;", if the comments aren't threaded, this commit doesn't output the cancel comment reply link (skips over that logic). Change in comment_form().

Adds tests.

Follow-up to [12810], [38959].

Props henrywright, jigneshnakrani, rachelbaker, desrosj, audrasjb, hellofromTonya.
Fixes #37267.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r52154 r52175  
    25392539        comment_form_title( $args['title_reply'], $args['title_reply_to'] );
    25402540
    2541         echo $args['cancel_reply_before'];
    2542 
    2543         cancel_comment_reply_link( $args['cancel_reply_link'] );
    2544 
    2545         echo $args['cancel_reply_after'];
     2541        if ( get_option( 'thread_comments' ) ) {
     2542            echo $args['cancel_reply_before'];
     2543
     2544            cancel_comment_reply_link( $args['cancel_reply_link'] );
     2545
     2546            echo $args['cancel_reply_after'];
     2547        }
    25462548
    25472549        echo $args['title_reply_after'];
Note: See TracChangeset for help on using the changeset viewer.