This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Description
Hi there,
I'm trying to get custom post types via the javascript client in the V2 API.
When I try this code:
self.events = new wp.api.collections.Posts;
self.events.fetch({
data: {
type: 'event',
context: 'view',
filter: {
nopaging: true
}
}
}).done( function() {
self.events.each( function( an_event ) {
console.log( an_event.attributes );
});
});
Nothing happens.
However if I change it to (for testing purposes) use (say) Pages:
self.events = new wp.api.collections.Pages;
self.events.fetch().done( function() {
self.events.each( function( an_event ) {
console.log( an_event.attributes );
});
});
It works correctly.
Do you know how I can retrieve custom post types via the WP-API V2 javascript api? (Or if it's possible).
Thanks!