| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * Plugin Name: CPT Cap Test |
|---|
| 4 | * Plugin URI: http://xavisys.com |
|---|
| 5 | * Description: CPT Cap Test |
|---|
| 6 | * Author: Aaron D. Campbell |
|---|
| 7 | * Author URI: http://xavisys.com |
|---|
| 8 | * Version: 0.1 |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | class SponsorsPostType { |
|---|
| 12 | private $_slug = 'sponsors'; |
|---|
| 13 | |
|---|
| 14 | public function __construct() { |
|---|
| 15 | add_action( 'init', array( $this, 'init') ); |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | public function init() { |
|---|
| 19 | $labels = array( |
|---|
| 20 | 'name' => _x('Sponsors', 'post type general name'), |
|---|
| 21 | 'singular_name' => _x('Sponsor', 'post type singular name'), |
|---|
| 22 | 'add_new' => _x('Add New', 'page'), |
|---|
| 23 | 'add_new_item' => __('Add New Sponsor'), |
|---|
| 24 | 'edit_item' => __('Edit Sponsor'), |
|---|
| 25 | 'new_item' => __('New Sponsor'), |
|---|
| 26 | 'view_item' => __('View Sponsor'), |
|---|
| 27 | 'all_items' => __('All Sponsors'), |
|---|
| 28 | 'search_items' => __('Search Sponsors'), |
|---|
| 29 | 'not_found' => __('No sponsors found'), |
|---|
| 30 | 'not_found_in_trash' => __('No sponsors found in Trash'), |
|---|
| 31 | 'parent_item_colon' => '', |
|---|
| 32 | 'items_archive' => __('Sponsor Archive'), |
|---|
| 33 | ); |
|---|
| 34 | |
|---|
| 35 | $supports = array( 'title', 'editor', 'author', 'excerpt', 'revisions', 'thumbnail' ); |
|---|
| 36 | |
|---|
| 37 | $args = array( |
|---|
| 38 | 'labels' => $labels, |
|---|
| 39 | 'description' => 'Sponsors', |
|---|
| 40 | 'public' => true, |
|---|
| 41 | 'hierarchical' => false, |
|---|
| 42 | 'supports' => $supports, |
|---|
| 43 | 'has_archive' => 'sponsors', |
|---|
| 44 | 'rewrite' => array( |
|---|
| 45 | 'feeds' => true |
|---|
| 46 | ), |
|---|
| 47 | // 'capability_type'=> 'sponsor' |
|---|
| 48 | ); |
|---|
| 49 | register_post_type( 'sponsor', $args ); |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | $SponsorsPostType = new SponsorsPostType(); |
|---|