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.

Built from https://develop.svn.wordpress.org/trunk@51125


git-svn-id: http://core.svn.wordpress.org/trunk@50734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2021-06-08 23:32:56 +00:00
parent 011a598fa1
commit 32ecbd061e
2 changed files with 3 additions and 11 deletions

View File

@ -27,7 +27,6 @@
* or query in an attempt to figure the correct page to go to.
*
* @since 2.3.0
* @since 5.8.0 Checks comment page count to limit pagination.
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
* @global bool $is_IIS
@ -505,15 +504,8 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
&& ( 'newest' === $default_comments_page && $cpage > 0
|| 'newest' !== $default_comments_page && $cpage > 1 )
) {
// Checks comment page count to limit pagination.
$per_page = get_option( 'comments_per_page' );
// Get the total number of pages for comments.
$comments_total_pages = ceil( ( $wp_query->post->comment_count ) / $per_page );
if ( $cpage <= $comments_total_pages ) {
$addl_path = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' );
$addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' );
}
$addl_path = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' );
$addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' );
$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-51124';
$wp_version = '5.8-alpha-51125';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.