[wp-trac] [WordPress Trac] #30831: paginate_links() now needs add_args=false

WordPress Trac noreply at wordpress.org
Thu Feb 12 02:19:47 UTC 2015


#30831: paginate_links() now needs add_args=false
------------------------------------------+-----------------------
 Reporter:  bobbingwide                   |       Owner:  dd32
     Type:  defect (bug)                  |      Status:  closed
 Priority:  normal                        |   Milestone:  4.1.1
Component:  Themes                        |     Version:  4.1
 Severity:  normal                        |  Resolution:  fixed
 Keywords:  has-patch fixed-major commit  |     Focuses:  template
------------------------------------------+-----------------------
Changes (by dd32):

 * owner:   => dd32
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31433"]:
 {{{
 #!CommitTicketReference repository="" revision="31433"
 In `paginate_links()`, don't override custom format arguments when setting
 up default 'add_args'.

 Since 4.1 [29780], the default value of the 'add_args' argument in
 paginate_links() has been determined by parsing the current URL. This
 change
 had the side effect of overriding custom values of 'format' that changed
 the
 pagination query var, with the result that plugins using
 `paginate_links()`
 with a custom format generated the incorrect links unless explicitly
 declaring 'add_args=false' to prevent the default values from overriding.
 We
 fix this behavior by parsing URL query vars into the 'add_args' array only
 after the explicit function params have been parsed, and by skipping the
 current page's pagination query var when doing this parsing (to avoid the
 override).

 Props obenland.
 Merges [31203], [31432] to the 4.1 branch.
 Fixes #30831.
 }}}

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


More information about the wp-trac mailing list