How to not allow custom roles to edit published custom post types?

Something like this (untested)

add_action( 'init', 'remove_revisor_cap_edit_posts' ); 

function remove_revisor_cap_edit_posts() {

if ( 'events' == get_post_type() ) {

$role = get_role( 'revisor' );
$role->remove_cap( 'edit_posts' );
    }
}

Leave a Comment