[wp-hackers] Community conventions for custom post types?

photofantaisie at gmail.com photofantaisie at gmail.com
Sat Aug 4 11:17:09 UTC 2012


My initial reaction was that this is a great idea. I've also come up  
against the issues the OP raised, and have been a little frustrated that I  
have had to reinvent the wheel to maintain some sort of compatibility with  
a plugin or theme.

However, what are we really talking about here? Off the top of my head, the  
main areas where one would like to see consistency are in naming  
conventions, eg post_type 'restaurant', rather than 'restaurants', for  
example, so that template naming is predictable, and rewrite rules. So, one  
convention could be that, like 'post' and 'page', the CPT registered name  
must be singular. But once you get beyond this, I'm not sure much can be  
standardised. For example, I would not support a convention that says  
that 'restaurant' must be non-hierarchical. In my use case, I may  
need 'restaurant' to be hierarchical. (Note: I hope I'm not  
misunderstanding the kind of conventions that people are thinking about.)

Re dev education, I would certainly like to see further promotion and  
reinforcement that CPTs and CTAX's should never be are registered by a  
theme, only a plugin.


More information about the wp-hackers mailing list