user roles - Administrator Posts

admin2025-06-05  2

I'm trying to prevent anyone in the Editor role from editing posts made by an Administrator. The Editor's can edit each others posts, just not an Administrator's. Is this possible? I've tried the Adminimize & Capability Manager Enhanced plugins, but no luck with those. Appreciate any help. Thank you!

I'm trying to prevent anyone in the Editor role from editing posts made by an Administrator. The Editor's can edit each others posts, just not an Administrator's. Is this possible? I've tried the Adminimize & Capability Manager Enhanced plugins, but no luck with those. Appreciate any help. Thank you!

Share Improve this question asked Dec 10, 2018 at 19:30 TonyVTonyV 1 4
  • There's not a built-in way to do this - a user either has the capability to edit_others_posts or he does not. You could add a conditional check to determine the role of the author before someone accesses the post edit screen for whichever post type(s) you want to affect, but you'd then also have to handle both Gutenberg and the Classic editor. It would probably be easiest if you create one CPT for Editors, and a separate one for Administrators, and then Editors will have edit_others_{cpt}s but not edit capability on the Administrators' CPT. – WebElaine Commented Dec 10, 2018 at 19:41
  • Thank you for the quick response! I installed the Disable Gutenberg plugin, if that would work. Would a work around be creating a category specific for admin posts, then restrict Editors from editing those? – TonyV Commented Dec 10, 2018 at 19:53
  • You could force a redirect if a editor clicked edit on a admin post to the post list. Would you be interested in that? I can draft up the code. – Liam Stewart Commented Dec 10, 2018 at 19:58
  • If it's not too much trouble, I would appreciate that. I imagine that would go into the functions.php file? – TonyV Commented Dec 10, 2018 at 20:36
Add a comment  | 

2 Answers 2

Reset to default 0

You can possibly try the following:

  1. Install ACF plugin and can create a front end page to edit any posts. (I have done this)

  2. Next, write a code to make sure that the post is not authored by the administrator. (I didnt try this out yet)

It looks like I found exactly what I needed with the Post Lockdown plugin. It allows you to select posts that can only be edited by an Admin. Thank you to those that took the time out to respond & offer suggestioons.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749108792a316434.html

最新回复(0)