archetyped / cornerstone

Enhanced Content Management for Wordpress
http://archetyped.com/tools/cornerstone/
GNU General Public License v2.0
6 stars 1 forks source link

Uppercase content type does not work #8

Closed numito closed 8 years ago

numito commented 8 years ago

If you create a content type with uppercase letters then CNR won't work. Meta boxes won't be added to the edit form. The reason is the content type id passed in the url is always lowercase, thus when trying to match the content type registered with the content type in the url it fails because they have different cases. Solution change the Content type constructor to make the id lowercase

Ex: fails because "Topics" starts with a uppercase letter.

$topic =& new CNR_Content_Type('Topic');

Solution: add strtolower in constructor of class CNR_Content_Base, line 78.

$id = strtolower(trim($id));
archetyped commented 8 years ago

Hi, as CNR creates WordPress custom post types, post type ID rules for CNR_Content_Type() are the same as WordPress' own register post type() function. For example:

cannot contain capital letters or spaces

See WordPress' register_post_type() documentation for more details.