[wp-trac] [WordPress Trac] #34106: Comments should have real permalinks
WordPress Trac
noreply at wordpress.org
Thu Oct 1 04:41:22 UTC 2015
#34106: Comments should have real permalinks
--------------------------+----------------------------
Reporter: boonebgorges | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Comments | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
--------------------------+----------------------------
The closest think we have to comment permalinks are links like this:
`example.com/my-post/comment-page-3/#comment-123`
This is very fragile:
* comment-page-x is sometimes optional, as when oldest comments are
displayed first, and `my-post/comments-page-1/` is the same as `my-post/`
* If you change the number of comments per page, the link is no longer
correct
* URL fragments (the stuff after `#`) are client-side only. Remember
hashbangs? https://www.w3.org/blog/2011/05/hash-uris/
* Pagination URLs are ugly and should not be used for canonical purposes
I propose something along the following lines:
* `example.com/comment/123` rewrites to `example.com/?comment_id=123`
* `WP_Query` will translate `comment_id` into the proper values for `p`
and `cpage`
* `redirect_canonical()` will send you to `example.com/my-post/comment-
page-3/#comment-123`
Comment pagination settings can change at any time, and permalinks will
continue to work.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34106>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list