[wp-trac] [WordPress Trac] #38484: REST API JS Client: currentPage should be set to the "paged" filter variable

WordPress Trac noreply at wordpress.org
Tue Oct 25 12:24:39 UTC 2016


#38484: REST API JS Client: currentPage should be set to the "paged" filter
variable
-----------------------------+-------------------------
 Reporter:  adamsilverstein  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  4.7
Component:  REST API         |    Version:  trunk
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:  javascript       |
-----------------------------+-------------------------
 Moving this issue over from Github: https://github.com/WP-API/client-
 js/issues/133

 peterigz commented on Aug 23:

 ''If you fetch a post collection and use the "paged" filter variable to
 get a certain page, then when using .more() it will fetch the same page
 over and over again because the request['filter'] variable is merged with
 the $args variable in the rest controller
 WP_REST_Posts_Controller::get_items therefore overwriting/ignoring the
 request['page'] value.''

 ''So I think that the state.currentPage should be set to "paged" if it
 exists and then delete the "paged" variable from the filter so .more()
 then works as you'd expect. I'm doing this manually as a work around and
 it works fine but maybe this can be considered a bug?''

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38484>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list