Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Custom Post Types #25

Closed
kadamwhite opened this issue Jun 23, 2014 · 2 comments
Closed

Support Custom Post Types #25

kadamwhite opened this issue Jun 23, 2014 · 2 comments
Assignees

Comments

@kadamwhite
Copy link
Collaborator

Before this is released, we need to have support for custom post types.

Alternative syntaxes under consideration:

Generic types handled by a single types endpoint handler:

var wp = new WP( options );

wp.types( 'cpt_event_listing' ).then(/* ... */);

Create custom endpoint handlers with a registerType utility method (see #7):

var wp = new WP( options );
wp.eventListings = wp.registerPostType( 'cpt_event_listing' );

wp.eventListings().get().then(/* ... */);

In either case, the type method would wrap .posts() but would set properties to specify a type query parameter to filter results.

@carldanley, I'm particularly interested in your opinion here since you're familiar with the WP internals

@kadamwhite kadamwhite added this to the Public Release milestone Jun 23, 2014
@kadamwhite kadamwhite self-assigned this Jun 23, 2014
@kadamwhite
Copy link
Collaborator Author

@rmccue +1'd my proposed pairing of wp.posts().types( 'some_cpt' ) and wp.myType = wp.registerType( 'my_cpt' ) as our custom post type methods of choice. This issue will be closed out by #52.

@kadamwhite
Copy link
Collaborator Author

Merged #52: closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant