Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Created October 21, 2013 03:40
Show Gist options
  • Save jamiemitchell/7078327 to your computer and use it in GitHub Desktop.
Save jamiemitchell/7078327 to your computer and use it in GitHub Desktop.
Register "Slides" CPT
<?php
/* Slides Post Type
------------------------------------------------------------ */
add_action('init','jm_create_slides_init');
function jm_create_slides_init() {
$labels = array
(
'name' => _x('Slides', 'post type general name', 'jm'),
'singular_name' => _x('slide', 'post type singular name', 'jm'),
'add_new' => _x('Add New', 'Slide', 'jm'),
'add_new_item' => __('Add New Slide', 'jm'),
'edit_item' => __('Edit Slide', 'jm'),
'new_item' => __('New Slide', 'jm'),
'view_item' => __('View Slides', 'jm'),
'search_items' => __('Search Slides', 'jm'),
'not_found' => __('No Slides found', 'jm'),
'not_found_in_trash' => __('No Slides found in Trash', 'jm'),
'parent_item_colon' => ''
);
$support = array
(
'title',
'editor',
'author',
'thumbnail',
'custom-fields',
'revisions'
);
$args = array
(
'labels' => $labels,
'public' => FALSE,
'show_ui' => TRUE,
'capability_type' => 'page',
'hierarchical' => FALSE,
'query_var' => FALSE,
'supports' => $support,
'menu_position' => 6
);
register_post_type('slide',$args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment