An open API service indexing awesome lists of open source software.

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.

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).

WebDevStudios. WordPress for big brands.

#### 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();
```