Is there a way to create one role with one capability and apply it to some of the custom post types?
What I am doing right now is ending up with applying capabilities to all of the posts..
creating role:
$wp_roles->add_role( 'member', 'Paid Membership', array(
'has_paid' => true,
'has_registered' => true
) );
creating a custom post type (i use a class but you ll get the idea)
AN_Posts::AddPostType( static::post_type, array( 'Group', 'Groups', 'groups' ), array( 'description' => 'A user group',
'map_meta_cap' => true,
'capability_type' => 'an_group',
'capabilities' => array( 'read_post' => 'has_registered',
) ) );
check permission
if ( is_single() && ! current_user_can( 'read_post', $post->ID ) )
$wp_query->is_404 = true;
Any ideas where i am doing it wrong?
Thanks!