You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently become super interested in using the backbone javascript client for some React-based settings pages but I'm finding it increasingly difficult to use. I feel like the documentation needs a bit of an update.
Extending custom post types won't take the new URL root
Documentation specifies the following for custom post types
// Extend wp.api.models.Post and wp.api.collections.Posts to load a custom post typeconstCustomPost=wp.api.models.Post.extend({urlRoot: wpApiSettings.root+'wp/v2/custom_post_slug',defaults: {type: 'custom_post_slug',},});
Yet when you extend the model and try save to the API it completely ignores the specified URL root.
Documentation relating to custom post type collections specifies an ambiguous type.
In the section relating to custom post type collections it mentions an ambiguous type 'BLProduct'. Is this supposed to be CustomPost?
constCustomPosts=wp.api.collections.Posts.extend({url: wpApiSettings.root+'wp/v2/custom_post_slug',model: BLProduct,});constsomeCustomPosts=newCustomPosts();someCustomPosts.fetch().then((posts)=>{// do something with the custom posts});
Some other minor issues I've discovered.
No documentation on post.setMeta functions (they also seem to error out when doing so).
No documentation on how to use the MetaData models
Code does not appear to be open-sourced so debugging problems like these is really difficult
Backbone client seems like an extremely powerful and handy tool and I feel it really needs some attention and love from wordpress.
The text was updated successfully, but these errors were encountered:
I've recently become super interested in using the backbone javascript client for some React-based settings pages but I'm finding it increasingly difficult to use. I feel like the documentation needs a bit of an update.
Specifically speaking this link here
Some of the problems I've noticed are as follows
Extending custom post types won't take the new URL root
Documentation specifies the following for custom post types
Yet when you extend the model and try save to the API it completely ignores the specified URL root.
Documentation relating to custom post type collections specifies an ambiguous type.
In the section relating to custom post type collections it mentions an ambiguous type 'BLProduct'. Is this supposed to be CustomPost?
Some other minor issues I've discovered.
Backbone client seems like an extremely powerful and handy tool and I feel it really needs some attention and love from wordpress.
The text was updated successfully, but these errors were encountered: