Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#39792 closed enhancement (fixed)

get_the_comments_pagination should accept the list type argument

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

Description

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'.

Comments:

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

https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/link-template.php#L2868

Posts:

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

https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/link-template.php#L2527

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

@jainnidhi
10 years ago

Patch attached.

#1 @jainnidhi
10 years ago

  • Keywords has-patch needs-testing added

I've attached a patch 39792.diff

#2 @SergeyBiryukov
9 years ago

  • Milestone Awaiting Review4.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
9 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

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.