Last active
October 27, 2018 14:35
-
-
Save basmiddelham/6fc2bb7376079d467a9db6bdcc6e76a6 to your computer and use it in GitHub Desktop.
Basic Custom Post Type with extended-cpts
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
<?php | |
/** | |
* Custom Post Type with extended-cpts | |
* http://johnbillion.com/extended-cpts/ | |
* https://github.com/johnbillion/extended-cpts | |
*/ | |
add_action('init', function () { | |
register_extended_post_type('project', [ | |
'has_archive' => false, | |
'admin_cols' => [ | |
'project_featured_image' => [ | |
'title' => 'Thumbnail', | |
'featured_image' => 'thumbnail', | |
'width' => 80, | |
'height' => 80, | |
], | |
'title' => [ | |
'title' => 'Title', | |
], | |
'project_description' => [ | |
'title' => 'Description', | |
'meta_key' => 'project_description', | |
], | |
], | |
], [ | |
'singular' => 'Project', | |
'plural' => 'Projects', | |
'slug' => 'project', | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment