Skip to content

Commit a0d3db3

Browse files
Coding Standards: Remove redundant $cpage checks from get_comment_link().
These checks would always be `true`, as `$cpage` is checked for a truthy value before entering the code block. Includes removing a duplicate `user_trailingslashit()` call, as there is a subsequent call a few lines below. Follow-up to [34735]. Props justlevine. See #63268. Built from https://develop.svn.wordpress.org/trunk@60408 git-svn-id: https://core.svn.wordpress.org/trunk@59744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 09fd75f commit a0d3db3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

wp-includes/comment-template.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -834,12 +834,8 @@ function get_comment_link( $comment = null, $args = array() ) {
834834

835835
if ( $cpage && get_option( 'page_comments' ) ) {
836836
if ( $wp_rewrite->using_permalinks() ) {
837-
if ( $cpage ) {
838-
$comment_link = trailingslashit( $comment_link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;
839-
}
840-
841-
$comment_link = user_trailingslashit( $comment_link, 'comment' );
842-
} elseif ( $cpage ) {
837+
$comment_link = trailingslashit( $comment_link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;
838+
} else {
843839
$comment_link = add_query_arg( 'cpage', $cpage, $comment_link );
844840
}
845841
}

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.9-alpha-60407';
19+
$wp_version = '6.9-alpha-60408';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)