Make WordPress Core

Changeset 60408


Ignore:
Timestamp:
07/03/2025 06:35:16 PM (8 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r60397 r60408  
    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        }
Note: See TracChangeset for help on using the changeset viewer.