Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Disable Code Editor #14647

Closed
myleshyson opened this issue Mar 26, 2019 · 4 comments · Fixed by #14932
Closed

Add Option to Disable Code Editor #14647

myleshyson opened this issue Mar 26, 2019 · 4 comments · Fixed by #14932
Assignees
Labels
[Feature] Code Editor Handling the code view of the editing experience [Feature] Extensibility The ability to extend blocks or the editing experience Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@myleshyson
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We are using Gutenberg for our UF Health sites which includes over 700+ sites and many more admins who aren't technical yet want to use the platform. It would really be nice if we can disable the Code Editor for them so they can only use the blocks we've specifically built for the platform. Otherwise we run into some trouble. Right now the only option is to disable the visual editor. That made sense with the classic editor but with something like Gutenberg I think it makes more sense to also have an option to disable the code editor. It's especially helpful as we try to enforce style standards across our stack.

Describe the solution you'd like
Please add an option, possibly to the block_editor_settings filter, to disable the code editor.

Describe alternatives you've considered
Right now the only thing I'm able to do is force the visual editor on load with the 'core\edit-post' data module.

@youknowriad youknowriad added [Type] Enhancement A suggestion for improvement. [Feature] Extensibility The ability to extend blocks or the editing experience [Feature] Code Editor Handling the code view of the editing experience labels Mar 27, 2019
@gziolo
Copy link
Member

gziolo commented Apr 10, 2019

@youknowriad, how do you envision to have it implemented? Would it be enough to disable it with block_editor_settings PHP filter and propagate to the editor through the settings store?

It looks like this technique is used to disable Visual mode as of today:

https://github.com/WordPress/gutenberg/search?q=isRichEditingEnabled&unscoped_q=isRichEditingEnabled

@gziolo gziolo added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Apr 10, 2019
@draganescu
Copy link
Contributor

@gziolo there are only two ways to implement:

  • a developer oriented one, where the block_editor_settings has and propagates a new isCodeEditingEnabled flag
  • a site admin oriented one, where in the Settings screen you can disable the code editor for certain roles

@myleshyson raised the issue for the developer experience, which is a GTB issue, I wonder if it would be a good WP feature as well?

@draganescu draganescu self-assigned this Apr 10, 2019
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Apr 10, 2019
@gziolo
Copy link
Member

gziolo commented Apr 10, 2019

Let's focus on the developer oriented one first.

@kanlukasz
Copy link

So which option disable this? I can't find this in the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Code Editor Handling the code view of the editing experience [Feature] Extensibility The ability to extend blocks or the editing experience Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants