﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
14122,"Custom ""capabilities"" appears broken on custom post types",jakemgold,nacin,"It's impossible to create a functional equivalent to a ""contributor"" role unique to a new custom content type, no what approach one takes. Consider the code below (the most stripped down code that exemplifies the point):

{{{
register_post_type('movies',array(
	'label' => 'Movies',
	'singular_label' => 'Movie',
	'public' => true,
	'capabilities' => array( 'edit_posts' => 'edit_movies' ),
	'supports' => array('title','editor','author')
));

if ( !get_role('producer') )
{
	global $wp_roles;
	if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
	
	$caps = $wp_roles->get_role('subscriber')->capabilities;
	$caps = array_merge( $caps, array( 'edit_movies' => true ) );
	$wp_roles->add_role( 'producer', 'Movie Producer', $caps );
}
}}}

Note that the ""Movies"" admin menu ''does'' appear for the ""producer"" role, along with the ""add new"" option. However, entering content into the editor produces a ""not allowed"" type error, and hitting ""submit for review"" produces a similar error.

Even if I'm missing something (maybe with the meta capabilities?) if the user is not allowed to edit a content type, they should not be presented with the menu options, including ""add new"".",task (blessed),closed,normal,3.1,Post Types,3.0,normal,fixed,,kevinB mikeschinkel@… admin@… andymacb
