How to stop contributors editing post type but allowing them to edit a custom post type?
Add the capabilities to the role. Replace ‘cpt’ with the name of your custom post type: $role = get_role( ‘contributor’ ); $role->add_cap( ‘delete_published_cpt’ ); $role->add_cap( ‘delete_others_cpt’ ); $role->add_cap( ‘delete_cpt’ ); $role->add_cap( ‘edit_others_cpt’ ); $role->add_cap( ‘edit_published_cpt’ ); $role->add_cap( ‘edit_cpt’ ); $role->add_cap( ‘publish_cpt’ ); But you shouldn’t add or remove caps on every page load. That’s why … Read more