Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#26133 closed defect (bug) (fixed)

Comment permalinks in notification emails should include pagination

Reported by: eatingrules's profile eatingrules Owned by: nacin's profile nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: has-patch
Focuses: Cc:


[This is my first time submitting a trac ticket - I apologize if I'm not doing it correctly. I searched the support forms (and posted a week ago but got no response), and have searched the trac for existing tickets, but didn't turn up anything that matched. Thanks!]

In Settings->Discussion, we have "Break Comments into pages with 25 top level comments per page and the last page displayed by default. We also have comments should be displayed with the older comments at the top of each page.

When a comment is first left by the reader, there may already be several pages of comments. The comment initially will appear on the default page (because we have the last page displayed by default), so the pagination is not necessary in the permalink:

However, by the time our moderator clicks the link, there have usually been several more pages of comments - so the anchor #comment-12345 doesn't do any good (because the original comment is no longer on the most recent page). She then has to page through the comments manually to find the comment, which is time-consuming and frustrating.

It would be far preferable for the permalink in the email notification to include the fully paginated link:

Attachments (1)

pluggable.php.patch (611 bytes) - added by eatingrules 10 years ago.
Add pagination to comment permalink in emails

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Comments

#2 @jeremyfelt
10 years ago

  • Version changed from 3.7.1 to 3.1

Thanks for the ticket submission, @eatingrules. No worries on process, you did great with the description. I'm not able to find a duplicate ticket either and this does sound like an interesting issue.

For reference, direct links to the comments were added through #12797 in 3.1.

At first glance, there may be a way for us to use get_comment_link() when generating the notification rather than the current get_permalink().

I do wonder how we would handle comments that change pages as moderation occurs. Links in the email may still be incorrect at some point.

#3 @eatingrules
10 years ago

I previously tried to find more info on the get_comment_link() function in the codex, but it didn't indicate if it includes the pagination in the link by default. If so, maybe it really is as simple a change as using that instead of get_permalink() in the emails?

You make a good point about pagination changes from commend moderation - though for us that's a lesser concern because it happens less often. However, perhaps a solution is to have a permalink+redirection system in place? There could be a standardized comment permalink URL generated, which then redirects to the current comment location.

Something like...

...which would then cause a database lookup to figure out where to redirect to, and then issues a 301 redirect to the current location of the comment:

Last edited 10 years ago by eatingrules (previous) (diff)

10 years ago

Add pagination to comment permalink in emails

#4 @eatingrules
10 years ago

I recently went ahead and modified pluggable.php to make this work for our assistant who responds to comments. Now the comment links in our email notifications include pagination, and are far more useful.

Just uploaded a patch for review! :)

#5 @SergeyBiryukov
10 years ago

#27161 was marked as a duplicate.

#6 @SergeyBiryukov
10 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.9

#7 @nacin
10 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 27567:

Use get_comment_link() in wp_notify_postauthor().

Fixes pagination for the link directly to the moderated comment.

props eatingrules.
fixes #26133.

Note: See TracTickets for help on using tickets.