Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#39792 closed enhancement (fixed)

get_the_comments_pagination should accept the list type argument

Reported by: poena Owned by: SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.7.1
Component: Themes Keywords: has-patch needs-testing
Focuses: Cc:


get_the_comments_pagination uses paginate_links, which allows the following type arguments:
'plain', 'array' and 'list'. Default is 'plain'.

But compared to get_the_posts_pagination that changes 'array' to 'plain' but allows the 'list' type, get_the_comments_pagination always sets it to 'plain'.


// Make sure we get plain links, so we get a string we can work with.
$args['type'] = 'plain';


// Make sure we get a string back. Plain is the next best thing.
if ( isset( $args['type'] ) && 'array' == $args['type'] ) {
    $args['type'] = 'plain';

Attachments (1)

39792.diff (604 bytes) - added by jainnidhi 5 years ago.
Patch attached.

Download all attachments as: .zip

Change History (4)

5 years ago

Patch attached.

#1 @jainnidhi
5 years ago

  • Keywords has-patch needs-testing added

I've attached a patch 39792.diff

#2 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 4.9

Changed in [30820] for get_the_posts_pagination().

get_the_comments_pagination() was introduced later in [34367], but didn't get this change. Seems like an oversight.

#3 @SergeyBiryukov
4 years ago

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

In 41236:

Link Template: Allow the type argument to be passed through get_the_comments_pagination() as long as its value isn't array.

See [30820] for `get_the_posts_pagination().

Props jainnidhi, poena.
Fixes #39792.

Note: See TracTickets for help on using tickets.