On creation of a custom post type I’m trying to define capabilities but it’s not working. What’s wrong with this code?
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title'),
'capabilities' => array(
'edit_post' => 'edit_video',
'edit_posts' => 'edit_videos',
'edit_others_posts' => 'edit_others_videos',
'publish_posts' => 'publish_videos',
'read_post' => 'read_videos',
'read_private_posts' => 'read_private_videos',
'delete_post' => 'delete_videos'
)
);
You code seems to be correct. Try the following instead.
Update:
You have to do some extra steps before making it work with the members plugin. See this forum post from Justin Tadlock (developer of the members plugin).
http://wordpress.org/support/topic/anyone-managed-to-get-custom-post-types-capabilities-working/page/2#post-1593534
This plugin seems to be doing it automatically:
http://wordpress.org/extend/plugins/map-cap/
check this out, it might be very useful:
http://themergency.com/generators/wordpress-custom-post-types/
http://themergency.com/generators/wordpress-custom-taxonomy/