Make WordPress Core

Opened 15 years ago

Closed 9 years ago

#8755 closed defect (bug) (wontfix)

Should be able to specify page order with wp_list_comments()

Reported by: marky's profile marky Owned by:
Milestone: Priority: normal
Severity: major Version: 2.7
Component: Comments Keywords: needs-patch close
Focuses: Cc:

Description

Passing the parameters reverse_top_level and reverse_children into the wp_list_comments() function only reverses the order of the comments on each page, and not the entire comment list overall. It is therefore impossible to display the newest comments first using this function, when comments are great enough to be paged. At least, not without globally changing the comment order for the entire site using the Discussion settings screen so that the "last" page is displayed first.

It should be possible to specify the page order in wp_list_comments() by, for example, passing a page_order parameter with 'asc' or 'desc' available.

Attachments (1)

8755.patch (1.5 KB) - added by Viper007Bond 15 years ago.
Don't commit me

Download all attachments as: .zip

Change History (15)

#1 @marky
15 years ago

  • Milestone changed from 2.7.1 to 2.8

#2 @Viper007Bond
15 years ago

  • Owner set to Viper007Bond

@Viper007Bond
15 years ago

Don't commit me

#3 follow-up: @Viper007Bond
15 years ago

This is a lot trickier than it may seem, namely due to how the paging links work as they are going off the option, especially any paging links that take place before wp_list_comments().

I'm almost thinking if you really want to force the default page via the theme that you do it via functions.php and then get_option() filter.

#4 in reply to: ↑ 3 ; follow-up: @marky
15 years ago

Replying to Viper007Bond:

This is a lot trickier than it may seem, namely due to how the paging links work as they are going off the option, especially any paging links that take place before wp_list_comments().

Then could the option to reverse the page order be provided to the previous_comments_link() and next_comments_link() functions instead?

Specifying the comment order---even across pages---seems like a reasonable feature, and I just don't believe that putting a custom hack into functions.php would be an acceptable solution to it.

Personally, I think it would be nice to even allow the newest comments appear on page 1, even though it would break the permalinks, if the designer so chooses.

#5 in reply to: ↑ 4 @Viper007Bond
15 years ago

Replying to marky:

Personally, I think it would be nice to even allow the newest comments appear on page 1, even though it would break the permalinks, if the designer so chooses.

That was done entirely on purpose. Page 1 will always contain the oldest posts regardless of settings, but you can control if page 1 or the latest page shows up by default.

If newest comments were added to /post/comments-page-1/, then older comments would constantly be changing pages. It'd be impossible to link to a particular comment and it'd also be bad for Google results. What if a Google result was a comment on a post/page but when you went there, the comment wasn't there?

#6 @Viper007Bond
15 years ago

  • Owner Viper007Bond deleted

#7 follow-up: @marky
15 years ago

Well, this is probably a discussion for a different issue, but isn't that precisely how blog posts themselves are organised? Going to /blog/page/2/, /blog/page/3/, etc. Every day, the content at those URLs might be different. I agree that there are consequences to choosing such an option for comments, but shouldn't it ultimately be up to the blog's administrator to decide this?

#8 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added; wp_list_comments page order removed
  • Severity changed from normal to major
  • Type changed from enhancement to defect (bug)

this is not an enhancement, it's a bug.

#9 in reply to: ↑ 7 @Viper007Bond
15 years ago

Replying to marky:

Well, this is probably a discussion for a different issue, but isn't that precisely how blog posts themselves are organised? Going to /blog/page/2/, /blog/page/3/, etc. Every day, the content at those URLs might be different.

Except when you link to a single post, you link to /blog/2009/05/02/post-name/ or whatever, not /blog/page/2/#post-123.

If I post (on my blog) a link to a specific comment on your blog, that link should be valid a day, a week, or even a year from now regardless of how many comments come after. The only exception is if you change how many comments are displayed per page and not much can be done about that other than using a query var (which I have fooled around with in the past, but finally opted not to use).

#10 @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.8 to Future Release

punting to future, pending patch

#11 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Future Release to 2.9

#12 @ryan
14 years ago

  • Milestone changed from 2.9 to Future Release

#13 @chriscct7
10 years ago

  • Keywords close added

When the addition of the setting to control which page of comments (Defaults to last) should be shown first, that setting and the application of reverse_top_level to true will reverse the entire list.

#14 @rachelbaker
9 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.