From df540dbd95c8b5cbcc265266a23a493c564a9432 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 16 Nov 2021 02:14:59 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@52175 git-svn-id: http://core.svn.wordpress.org/trunk@51767 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 8 +++++--- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 7549316b78..e056d7b2db 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -2538,11 +2538,13 @@ function comment_form( $args = array(), $post_id = null ) { comment_form_title( $args['title_reply'], $args['title_reply_to'] ); - echo $args['cancel_reply_before']; + if ( get_option( 'thread_comments' ) ) { + echo $args['cancel_reply_before']; - cancel_comment_reply_link( $args['cancel_reply_link'] ); + cancel_comment_reply_link( $args['cancel_reply_link'] ); - echo $args['cancel_reply_after']; + echo $args['cancel_reply_after']; + } echo $args['title_reply_after']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 453c461042..2b5001dfdd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52174'; +$wp_version = '5.9-alpha-52175'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.