Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*create event custom post type. change $keyword and $slug to update CPT */
- function dct_cpt_event() {
- $keyword = 'Event';
- $slug = 'event';
- $labels = array(
- 'name' => $keyword .'s',
- 'singular_name' => $keyword,
- 'add_new' => 'Add New',
- 'add_new_item' => 'Add New ' . $keyword,
- 'edit' => 'Edit',
- 'edit_item' => 'Edit ' . $keyword .'s',
- 'new_item' => 'New ' . $keyword .'s',
- 'all_items' => 'All ' . $keyword .'s',
- 'view' => 'View',
- 'view_item' => 'View ' . $keyword .'s',
- 'search_items' => 'Search ' . $keyword .'s',
- 'not_found' => 'No ' . $keyword . ' found',
- 'not_found_in_trash' => 'No ' . $keyword . ' found in Trash',
- 'parent' => 'Parent ' . $keyword,
- 'menu_name' => $keyword .'s'
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'menu_position' => '5.1',
- 'public' => true,
- 'has_archive' => true,
- 'rewrite' => array('slug' => $slug),
- 'supports' => array( 'title', 'editor', 'author', 'excerpt', 'revisions' ),
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'map_meta_cap' => true
- );
- register_post_type( $slug, $args );
- }
- add_action( 'init', 'dct_cpt_event' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement