I've got a custom post type that I want to allow a specific user role to add posts to, however they must not be able to read posts from others.
Here's my custom post type code:
register_post_type('product', array(
'labels' => create_post_type_labels('Product'),
'public' => TRUE,
'query_var' => TRUE,
'rewrite' => array('slug' => 'products', 'with_front' => FALSE),
'capability_type' => 'directory',
'capabilities' => array(
'edit_post' => "edit_directory",
'read_post' => "read_directory",
'delete_post' => "delete_directory",
'edit_posts' => "edit_directorys",
'edit_others_posts' => "edit_others_directorys",
'publish_posts' => "publish_directorys",
'read_private_posts' => "read_private_directorys",
'delete_posts' => "delete_directorys",
'delete_private_posts' => "delete_private_directorys",
'delete_published_posts' => "delete_published_directorys",
'delete_others_posts' => "delete_others_directorys",
'edit_private_posts' => "edit_private_directorys",
'edit_published_posts' => "edit_published_directorys"
),
'supports' => array('title', 'author'),
'has_archive' => TRUE
));
And here's a screenshot of the role permissions:
The problem I'm having is my directory contributor
user can still see the posts from the other users.
Can anyone spot an error in the way I am doing things here?