I started playing with an idea a few days ago that will be using custom post types. I’ve never used CPTs before and am running into issues with the basic registration process.
The following registration code is hooked into init
and I have verified that it is running, however I am not seeing “Slides” appear in the admin menu.
*EDIT: WP_DEBUG is enabled and nothing is being produced.*
register_post_type(self::$post_type, array(
'labels' => array(
'name' => __('Slides', 'bonestheme'),
'singular_name' => __('Slide', 'bonestheme'),
'add_new_item' => __('Add New Slide', 'bonestheme'),
'edit_item' => __('Edit Slide', 'bonestheme'),
'new_item' => __('New Slide', 'bonestheme'),
'view_item' => __('View Slide', 'bonestheme'),
'search_items' => __('Search Slides', 'bonestheme'),
'not_found' => __('No Slide Found', 'bonestheme'),
'not_found_in_trash' => __('No slides found in Trash', 'bonestheme')
),
'capability_type' => array('slide', 'slides'),
'description' => 'Represents a single slide in the header slideshow.',
'hierarchical' => false,
'menu_position' => 5,
'public' => false,
'register_meta_box_cb' => array('SlideJS', 'createCPTMetaboxes'),
'rewrite' => false,
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'show_ui' => true,
'supports' => array('title', 'thumbnail')
)
);
remove_post_type_support( self::$post_type, 'editor' );
Remove
This works