From e4b72ad5caa78814c6cf825d2cd9e22cc29c75e1 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 21 Oct 2015 16:25:31 +0000 Subject: [PATCH] Don't force comment pagination. [34561] instituted the policy of forcing pagination for comments. This strategy was intended to avert problems when 'page_comments' is set to 0 - as it is by default - and the number of comments on a given post rises into the hundreds or thousands. By forcing pagination in all cases, we ensured that WordPress would not time out by processing unwieldy numbers of comments on a given pageload. The strategy proves problematic, however, because comment permalinks are generated using the page of the comment. Forcing pagination for posts that were not previously paginated would change the URL of all comments that do not appear on the default comment page. This changeset reintroduces the 'page_comments' setting and its corresponding checkbox on Settings > Discussion. A number of tests, which were written after [34561], are modified to work now that 'page_comments' will, once again, be disabled by default. See #8071. git-svn-id: https://develop.svn.wordpress.org/trunk@35331 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/schema.php | 3 +- src/wp-admin/options-discussion.php | 4 +- src/wp-admin/options.php | 2 +- src/wp-includes/canonical.php | 5 +- src/wp-includes/comment-functions.php | 16 ++++-- src/wp-includes/comment-template.php | 52 ++++++++++--------- src/wp-includes/default-filters.php | 3 -- src/wp-includes/version.php | 2 +- .../tests/comment/commentsTemplate.php | 8 +++ .../phpunit/tests/comment/getCommentLink.php | 5 ++ .../tests/comment/getPageOfComment.php | 1 + 11 files changed, 64 insertions(+), 37 deletions(-) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index eea643024a..344ba5a9f1 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -482,6 +482,7 @@ function populate_options() { 'close_comments_days_old' => 14, 'thread_comments' => 1, 'thread_comments_depth' => 5, + 'page_comments' => 0, 'comments_per_page' => 50, 'default_comments_page' => 'newest', 'comment_order' => 'asc', @@ -567,7 +568,7 @@ function populate_options() { 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app', - 'embed_autourls', 'default_post_edit_rows', 'page_comments', + 'embed_autourls', 'default_post_edit_rows', ); foreach ( $unusedoptions as $option ) delete_option($option); diff --git a/src/wp-admin/options-discussion.php b/src/wp-admin/options-discussion.php index 02b4379526..3d59195fd4 100644 --- a/src/wp-admin/options-discussion.php +++ b/src/wp-admin/options-discussion.php @@ -98,6 +98,8 @@ printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments ?>
+