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

block_editor_settings filter #17892

Closed
michaelbourne opened this issue Oct 10, 2019 · 3 comments
Closed

block_editor_settings filter #17892

michaelbourne opened this issue Oct 10, 2019 · 3 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Comments

@michaelbourne
Copy link

michaelbourne commented Oct 10, 2019

Hey everyone, I'm trying to disable the code editor mode in Gutneberg. Based on old issues here and some PRs, I figured this code would work:

function prefix_custom_editor_settings( $settings, $post ) {

	$settings['richEditingEnabled'] = true;
	$settings['codeEditingEnabled'] = false;
	$settings['titlePlaceholder'] = 'Write a captivating title!';

    return $settings;
}
add_filter( 'block_editor_settings', 'prefix_custom_editor_settings', 10, 2 );

The titlePlaceholder was added as a test and it worked perfectly. Problem is, the code editor is still available.

Any tips?

@swissspidy swissspidy added [Type] Help Request Help with setup, implementation, or "How do I?" questions. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. [Status] Needs More Info Follow-up required in order to be actionable. labels Oct 14, 2019
@swissspidy
Copy link
Member

Hi there and thanks for your report!

Which version of WordPress and Gutenberg are you using?

@michaelbourne
Copy link
Author

Hey @swissspidy

This is a default installation of WP 5.2.4 and its bundled Gutenberg version.

It might be good to note that the above code snippet works as intended in 5.3-RC1-46558 (Bleeding Edge update via Beta tester plugin), so this issue may be moot, however I was unable to locate a specific PR that fixed it.

@swissspidy
Copy link
Member

This feature was introduced in #14932, which I don‘t think is in 5.2. Therefore closing as it‘s working in 5.3 / current GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

No branches or pull requests

2 participants