[wp-trac] [WordPress Trac] #9069: Function get_comment_link returns duplicate URLs for comments available at permalink

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 8 11:54:59 GMT 2009


#9069: Function get_comment_link returns duplicate URLs for comments available at
permalink
---------------------------+------------------------------------------------
 Reporter:  GregMulhauser  |       Owner:       
     Type:  defect (bug)   |      Status:  new  
 Priority:  normal         |   Milestone:  2.7.1
Component:  Comments       |     Version:  2.7  
 Severity:  normal         |    Keywords:       
---------------------------+------------------------------------------------
 When paging is active, get_comment_link always returns URLs with "comment-
 page-", even when the comment is available at the post's permalink,
 creating two different URLs for reaching the same comment. Ideally (IMHO),
 all parts of WordPress should always use the same URL for reaching any
 given comment.

 For example, the first comment of a post may be available here:

 http://example.com/example-post/#comment-1

 But get_comment_link returns:

 http://example.com/example-post/comment-page-1/#comment-1

 It is partly the fault of get_page_of_comment that get_comment_link is
 doing this (depends on ascending vs. descending order), but unfortunately
 other functions, plugins, etc., may already be relying on
 get_page_of_comment continuing to work the way it does now. Since this
 behaviour can't easily be fixed in get_comment_link itself without also
 altering get_page_of_comment, I'd like to suggest that the value returned
 by get_comment_link simply be wrapped in apply_filters.

 That way, users (or plugin authors) who would like to get rid of
 extraneous "comment-page-1" and similar duplicate comment URLs can 'fix'
 the output of the function to provide unique comment URLs, while those who
 don't consider it broken in the first place (and are happy to have
 multiple URLs for the same comment) can keep the existing behaviour.

 All the best,
 Greg

-- 
Ticket URL: <http://trac.wordpress.org/ticket/9069>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list