[wp-trac] [WordPress Trac] #34068: Comment permalink always include comment page

WordPress Trac noreply at wordpress.org
Thu Oct 1 05:12:42 UTC 2015


#34068: Comment permalink always include comment page
--------------------------+---------------------------
 Reporter:  knutsp        |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Comments      |     Version:  trunk
 Severity:  normal        |  Resolution:  invalid
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------------

Comment (by boonebgorges):

 In [changeset:"34735"]:
 {{{
 #!CommitTicketReference repository="" revision="34735"
 Ensure that comment permalinks reflect pagination.

 After [34561], `wp_list_comments()` no longer passed all of a post's
 comments
 to `Walker_Comments`. As a result, calls to `get_comment_link()` occurring
 inside the comment loop had insufficient context to determine the proper
 'cpage' value to use when generating comment permalinks. This, in turn,
 caused
 comment permalinks to behave erratically.

 The current changeset addresses the problem as follows:

 * `get_comment_link()` now accepts a 'cpage' parameter. When present,
 'cpage' will be used to build the comment permalink - no automatic
 calculation will take place.
 * When called within the main loop, `wp_list_comments()` calculates the
 proper 'cpage' value for comments in the loop, and passes it down to
 `get_comment_link()`.
 * `cpage` and `comment-page-x` query vars are generally required in
 comment permalinks (see #34068), but an exception is made when
 'default_comment_page=oldest': the bare post permalink will always be the
 same as `cpage=1`, so `cpage` is excluded in this case.

 Props peterwilsoncc for assiduous spreadsheeting.
 Fixes #34073.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34068#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list