kadamwhite/wordpress-rest-api — pull request #52 by kadamwhite (2014-06-30 07:37:43+00:00)
Title: Add a registerType method to create custom post type shortcuts

It is not hard to specify a post type request via
```javascript
wp.posts().type( 'some_cpt' )... // continue with request
```
However, if you are building an application that relies very heavily on custom types, you may find yourself wanting a convenience method for requesting your own custom type. This PR adds a `registerType` method to `WP` instances, which can be used to define a convenience method of that sort:
```javascript
// Defines a CPT handler `events()` on the current WP instance
wp.events = wp.registerType( 'event_cpt' );

// wp.events() can bow be used to specify requests for that custom post type quickly
wp.events().then(function( eventItems ) {
// Do something with the returned collection of event objects
});
```