Make WordPress Core


Ignore:
Timestamp:
06/08/2021 11:31:46 PM (4 years ago)
Author:
whyisjake
Message:

Permalinks: Revert the changes stemming from pagination limits.

In [51118], an attempt was made to add pagination limits. The added tests need to be updated to ensure that they pass with the new changes.

Reverts [51118].

See #50233.

File:
1 edited

Legend:

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

    r51118 r51125  
    2828 *
    2929 * @since 2.3.0
    30  * @since 5.8.0 Checks comment page count to limit pagination.
    3130 *
    3231 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
     
    506505                    || 'newest' !== $default_comments_page && $cpage > 1 )
    507506            ) {
    508                 // Checks comment page count to limit pagination.
    509                 $per_page = get_option( 'comments_per_page' );
    510 
    511                 // Get the total number of pages for comments.
    512                 $comments_total_pages = ceil( ( $wp_query->post->comment_count ) / $per_page );
    513                 if ( $cpage <= $comments_total_pages ) {
    514                     $addl_path  = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' );
    515                     $addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' );
    516                 }
     507                $addl_path  = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' );
     508                $addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' );
    517509
    518510                $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
Note: See TracChangeset for help on using the changeset viewer.