Skip to content

Commit 18749a4

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. git-svn-id: https://develop.svn.wordpress.org/trunk@60408 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 972da8c commit 18749a4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/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
}

0 commit comments

Comments
 (0)