WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#8058 closed enhancement (fixed)

Please add get_previous_comments_link() and get_next_comments_link() functions.

Reported by: nkuttler Owned by: Viper007Bond
Priority: normal Milestone: 2.7.1
Component: Comments Version: 2.7
Severity: minor Keywords: has-patch
Cc:

Description

Why would they be useful? If you enable comment paging it should be possible to hide the page browser if there are no next / previous comment pages. Current solution

if ( get_query_var('cpage') > 1 || get_query_var('cpage') < get_comment_pages_count() ) {
// comment browser
}

Something like

if (get_previous_comments_link() || get_next_comments_link() ) {
//comment browser
}

would be much nicer for theme developers.

Attachments (3)

8058.patch (4.3 KB) - added by Viper007Bond 5 years ago.
New functions + code cleanup
8058.2.patch (4.2 KB) - added by Viper007Bond 5 years ago.
A little more code cleanup
8058.3.patch (2.7 KB) - added by Viper007Bond 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 nkuttler5 years ago

  • Component changed from General to Comments
  • Owner anonymous deleted

comment:2 Viper007Bond5 years ago

  • Keywords needs-patch added
  • Version set to 2.7

I'll take care of this later today (time for bed soon) if someone doesn't beat me to it.

Viper007Bond5 years ago

New functions + code cleanup

comment:3 Viper007Bond5 years ago

Attached patch should be entirely backwards compatible while adding the new functions.

comment:4 Viper007Bond5 years ago

  • Owner set to Viper007Bond

Viper007Bond5 years ago

A little more code cleanup

comment:5 azaozz5 years ago

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

(In [9632]) Fixes for previous/next page links, props Viper007Bond, fixes #8058

comment:6 Viper007Bond5 years ago

  • Milestone changed from 2.7 to 2.8
  • Resolution fixed deleted
  • Status changed from closed to reopened

Yet another reason why I need to stop coding at 4 AM. The ticket was for comment paging links, not post paging.

Viper007Bond4 years ago

comment:7 Viper007Bond4 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from 2.8 to 2.7.1

That should do the trick.

comment:8 ryan4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10239]) get_previous_comments_link() and get_next_comments_link(). Props Viper007Bond. fixes #8058 for trunk

comment:9 ryan4 years ago

(In [10240]) get_previous_comments_link() and get_next_comments_link(). Props Viper007Bond. fixes #8058 for 2.7

Note: See TracTickets for help on using tickets.