https://github.com/webdevstudios/cpt_core
This is a helper class for creating custom post types.. I'm sure it doesn't cover everything. PRs welcome.
https://github.com/webdevstudios/cpt_core
Last synced: 8 months ago
JSON representation
This is a helper class for creating custom post types.. I'm sure it doesn't cover everything. PRs welcome.
- Host: GitHub
- URL: https://github.com/webdevstudios/cpt_core
- Owner: WebDevStudios
- Created: 2013-11-12T14:26:38.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T20:17:25.000Z (about 8 years ago)
- Last Synced: 2025-08-19T15:06:51.446Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 78
- Watchers: 63
- Forks: 13
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CPT_Core
=========
A tool to make custom post type registration just a bit simpler. Automatically registers post type labels and messages, and provides helpful methods.
Also see [Taxonomy_Core](https://github.com/jtsternberg/Taxonomy_Core).
#### The simple way:
```php
array( 'title', 'editor', 'excerpt', 'thumbnail' ),
)
);
}
/**
* Registers admin columns to display. Hooked in via CPT_Core.
* @since 0.1.0
* @param array $columns Array of registered column names/labels
* @return array Modified array
*/
public function columns( $columns ) {
$new_column = array(
'headshot' => sprintf( __( '%s Headshot', 'your-text-domain' ), $this->post_type( 'singular' ) ),
);
return array_merge( $new_column, $columns );
}
/**
* Handles admin column display. Hooked in via CPT_Core.
* @since 0.1.0
* @param array $column Array of registered column names
*/
public function columns_display( $column, $post_id ) {
switch ( $column ) {
case 'headshot':
the_post_thumbnail();
break;
}
}
}
new Actress_CPT();
```
