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

WordPress Trac noreply at wordpress.org
Sun Dec 4 20:13:31 UTC 2016


#39070: WP-API JS client can't use getCategories for models returned by collections
------------------------------+-----------------------------------
 Reporter:  jesseenterprises  |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  REST API          |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  javascript, rest-api
------------------------------+-----------------------------------

Comment (by jesseenterprises):

 [attachment:39070.diff] fixes an issue where models automatically created
 as children of fetched collections didn't have appropriate mixin methods,
 like `.getCategories`, applied. This is resolved by defining the `model`
 property of fetched collections as a function returning an instantiated
 model, instead of a static model prototype.

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


More information about the wp-trac mailing list