I created a CPT "meal" using the Metabox UI and I want to create a user role that will allow the user to only create and edit (not delete) "meal" posts that they created.
I am using the following code, but the Meal posts menu item doesn't show up for that user.
How can I make this work?
function create_meal_contributor_role() {
add_role('meal_contributor', 'Meal Contributor', array('read' => true));
$role = get_role('meal_contributor');
$role->add_cap('read_meal_posts');
$role->add_cap('edit_meal_posts');
$role->add_cap('edit_published_meal_posts');
$role->add_cap('publish_meal_posts');
$role->add_cap('delete_meal_posts', false);
}
add_action('init', 'create_meal_contributor_role');