[wp-trac] [WordPress Trac] #41056: WP-API JS Client: Settings is incorrectly registered as a collection

WordPress Trac noreply at wordpress.org
Mon Jul 24 20:45:25 UTC 2017


#41056: WP-API JS Client: Settings is incorrectly registered as a collection
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:
     Type:  defect (bug)                         |  adamsilverstein
 Priority:  normal                               |      Status:  closed
Component:  General                              |   Milestone:  4.8.1
 Severity:  normal                               |     Version:  4.7
 Keywords:  has-patch has-unit-tests commit      |  Resolution:  fixed
  fixed-major                                    |     Focuses:
                                                 |  javascript, rest-api
-------------------------------------------------+-------------------------
Changes (by westonruter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41126"]:
 {{{
 #!CommitTicketReference repository="" revision="41126"
 WP-API JS Client: Interpret Settings resource as a model.

 The REST API does not provide a mechanism to distinguish between endpoints
 representing models and those representing collections, so the Backbone
 client must make that distinction internally. Previously wp-api.js
 accounted for `/users/me`, but not for `/settings`. This patch updates the
 logic so that `/settings` is properly registered as a Backbone model.

 When calling `wp.api.init`, additional endpoints can be specified to be
 models using the `modelEndpoints` argument.

 Merges [41112] onto 4.8 branch.
 Props adamsilverstein, kadamwhite.
 Fixes #41056 for 4.8.1.
 }}}

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


More information about the wp-trac mailing list