[wp-trac] [WordPress Trac] #39070: WP-API JS client can't use getCategories for models returned by collections

WordPress Trac noreply at wordpress.org
Thu Dec 15 13:01:28 UTC 2016


#39070: WP-API JS client can't use getCategories for models returned by collections
------------------------------+-----------------------------------
 Reporter:  jesseenterprises  |       Owner:  adamsilverstein
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.7.1
Component:  REST API          |     Version:  4.7
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  javascript, rest-api
------------------------------+-----------------------------------

Comment (by adamsilverstein):

 In [changeset:"39604"]:
 {{{
 #!CommitTicketReference repository="" revision="39604"
 WP-API: JavaScript client - fix setup of models used by wp.api.collections
 objects.

 Correct setup for the `model` attribute of `wp.api.collections` objects.
 Set the collection model as a function that returns a new model of the
 underlying type, instead of setting it as the model prototype. Fixes an
 issue where models for fetched collections weren't set up properly and
 didn't have the expected mixin methods such as `getCategories` available.

 Props jesseenterprises.
 Merges [39603] to the 4.7 branch.
 Fixes #39070.
 }}}

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


More information about the wp-trac mailing list