[wp-trac] [WordPress Trac] #39447: Improvment to the get_the_posts_navigation

WordPress Trac noreply at wordpress.org
Sat Jan 4 03:28:33 UTC 2020


#39447: Improvment to the get_the_posts_navigation
-------------------------------------+------------------------------
 Reporter:  thirumani02              |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Query                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------
Changes (by Howdy_McGee):

 * keywords:   => has-patch needs-testing


Comment:

 This patch adds additional $args to the `get_the_posts_navigation()` and
 `get_the_posts_pagination()` functions to handle `max_num_pages`. Instead
 of defaulting to the `global $wp_query->max_num_pages` you can pass a
 defined integer:


 {{{
 get_the_posts_navigation( array( 'max_num_pages' => 3 ) );
 get_the_posts_pagination( array( 'max_num_pages' => 3 ) );
 }}}

 I've tested this patch with a custom query and the default posts.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39447#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list