Created
February 29, 2012 10:46
-
-
Save imgiseverything/1939868 to your computer and use it in GitHub Desktop.
IMG Custom Post Types: Complex Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (class_exists('IMGCustomPostTypes') === true ) { // chekc for plugin activation | |
// 1 Initialise a new custom post type | |
$cpt_example = new IMGCustomPostTypes(); | |
// 2 Add your custom fields | |
$cpt_example->customFields = array('example_foo', 'example_bar'); | |
// 3 Set your naming conventions | |
$cpt_example->namingConventions = array( | |
'name' => 'example', | |
'singular' => 'Example', | |
'plural' => 'Examples', | |
'slug' => 'example', | |
'tag_name' => 'example_tags', | |
'tag_singular' => 'Example tag', | |
'tag_plural' => 'Example tags' | |
); | |
// 4 What WordPress functionality do you want to support? | |
$cpt_example->supports = array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment