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

WordPress Trac noreply at wordpress.org
Thu Jul 20 20:25:30 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
                                             |     Focuses:  javascript,
                                             |  rest-api
---------------------------------------------+-----------------------------
Changes (by kadamwhite):

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


Comment:

 In [changeset:"41112"]:
 {{{
 #!CommitTicketReference repository="" revision="41112"
 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.

 Props @adamsilverstein.
 Fixes #41056.
 }}}

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


More information about the wp-trac mailing list