[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 12:53: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
------------------------------+-----------------------------------
Changes (by adamsilverstein):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"39603"]:
{{{
#!CommitTicketReference repository="" revision="39603"
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.
Fixes #39070.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39070#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list