I have a custom post type with a certain amount of posts. What I have to do is to disable users from editing/updating certain posts of that post type, but not all of them.

I have to do that programmatically, so please no plugins.

Any ideas?

Users that are disallowed from updating/editing certain posts need to have the ability to read them.


You should use different roles for this groups of users, like CPT-Editor or CPT-Reader. It is much easier to check the role and his capabilities to change on posts. To change this capabilities in the roles use a plugin, like Members, or custom code. The capability for edit, read cpt is different, in dependence of your plugin, that add this CPT.

This question is really helpful in this context, via plugin and custom code is a answer deposited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.