How to *disable* the post content editor
Any good ideas on how to disable the post content editor? I don’t want to hide it, remove it, or remove the page.
The goal is to allow users with few permissions to view the edit screen so they can read the content, but not be able to make changes to the content. (I also need to figure out how to disable other elements on the page, but one step at a time).
I’ve done this with Javascript already by just targeting the textarea and added disabled
, but looking for a less flimsy method.
Background for why I need this: https://github.com/post-forking/post-forking/pull/105
I think the best way is remove it and then print the content out of any textarea, but just as html:
Maybe I am blond but above could be solved by just changing some role options?
I am aware that my answer is not pointing to question above but followed intentions you point yourself as mentioned in github. (questions/wishes are not equeal at all, here in question made above you want to disable edit and so also publish options and in github you want to disable publishing option but still able to edit!? (allowing Billy to make corrections)
Billy seems in a way some kind of editor (is not explained in github who the author is, but assuming he isn’t).
You could make changes in roles (I would make a new role with restrictions, enough for him to make ccorrections in the text) and restrict some options. (disable publish_posts/publish_pages)
Now he is able to make the text corrections and only able to click “submit for Review”. You as his Boss (assume you are the editor) are able to check and when needed make corrections and are able to publish when needed.
If my assuments are correct then this would be a fast and reliable way to achieve what you want. If I am totally incorrect, please tell and I will delete this answer.
you can remove the
<?php edit_post_link(); ?>
code in your single.php or post php to remove edit option..,i not use custom permission method and put that code inside if/else code where you checking that.,