$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>user roles - Administrator Posts|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

user roles - Administrator Posts

matteradmin9PV0评论

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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far