Skip to content

Instantly share code, notes, and snippets.

@basmiddelham
Last active October 27, 2018 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basmiddelham/6fc2bb7376079d467a9db6bdcc6e76a6 to your computer and use it in GitHub Desktop.
Save basmiddelham/6fc2bb7376079d467a9db6bdcc6e76a6 to your computer and use it in GitHub Desktop.
Basic Custom Post Type with extended-cpts
<?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