Ok, well that’s strange, it works for me, using your code, and with the capability uncommented.
// I didn't use your function or hook, i have my own so i just copied the register_post_type code for testing.
register_post_type( 'super_duper', array(
'labels' => array(
'name' => __( 'Super Dupers' ),
'singular_name' => __( 'Super Duper' )
),
'public' => true,
'capability_type' => 'super_duper'
) );
I did notice however that the Members plugin fails to detect the new capabilities registered by the custom post type, i had to add a couple for testing, namingly edit_super_dupers
and publish_super_dupers
(two of the capabilities available when you register the custom post type – listed under capabilities
on the register_post_type
codex page).
I updated the editor role(testing), by default an editor can edit the custom type already, so i unchecked the two capabilities i had added in (edit_super_dupers and publish_super_dupers). The result was as expected, the editor could no longer edit or add posts of a type super duper.
I corrected the stray comma in your code above (you may have noticed, however, the code worked with that error still present, so i don’t believe it’s the cause of your issue).
Perhaps something was fixed in the latest code, i’ll go back and test 3.0 if you want (3.1 alpha on my install).
Would you like me to test a particular role maybe, add a new role? If you want to give me a specific usage to test for i’ll be around for another hour or so, possibly two.
NOTE: When i register post types and taxonomies i use a hook like so..
add_action( 'init', 'register_taxonomies_and_types', 0 );
0 gives the hook highest priority, this might make a difference, it may not, just thought i’d mention it as it’s the one thing different on my end (apart from the WP version).
I’ll install 3.0 later today (maybe tomorrow – it’s the weekend have no idea what my plans are yet), and see if i can make the same progress, thus far, all seems to work as expected on my end.