[wp-trac] [WordPress Trac] #24606: Paginate links' "base" default value causes page 2 to display links incorrectly.

WordPress Trac noreply at wordpress.org
Tue Jun 17 13:59:15 UTC 2014


#24606: Paginate links' "base" default  value causes page 2 to display links
incorrectly.
---------------------------------------------+-----------------------------
 Reporter:  Nessworthy                       |       Owner:  SergeyBiryukov
     Type:  defect (bug)                     |      Status:  reopened
 Priority:  normal                           |   Milestone:  4.0
Component:  General                          |     Version:  2.1
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  template
---------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests commit


Comment:

 Replying to [comment:17 SergeyBiryukov]:
 > Not sure if `paginate_links()` should always use `paged` for
 consistency, or we should check `$wp_rewrite->using_permalinks()`, like we
 do to set `format`.

 [source:tags/3.9.1/src/wp-includes/link-template.php#L1888
 get_pagenum_link()] always uses `paged`, so [attachment:24606.6.diff]
 should be good to go.

 Core uses `paginate_links()` in [source:tags/3.9.1/src/wp-
 admin/includes/deprecated.php#L570 WP_User_Search::do_paging()],
 [source:tags/3.9.1/src/wp-admin/includes/media.php#L2332
 media_upload_library_form()], [source:tags/3.9.1/src/wp-admin/includes
 /nav-menu.php#L613 wp_nav_menu_item_post_type_meta_box()], and
 [source:tags/3.9.1/src/wp-includes/link-template.php#L2320
 paginate_comments_links()].

 All these instances pass their own `base`, `format`, `total`, and
 `current` values, so this patch doesn't affect them. It just sets better
 defaults, so that themes don't have to calculate them on their own, like
 Twenty Fourteen does now.

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


More information about the wp-trac mailing list